AIG. - AI Google Gemini Integration

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIG. - Google AI > B. Debugging and  Errorhandling >

AIG. - AI Google Gemini Integration

AIG.GetErrorHistory

Previous Top Next


MiniRobotLanguage (MRL)

 

AIG.GetErrorHistory
Retrieve Cumulative Error Log

 

Intention

 

Retrieves the full chronological history of errors that have occurred since the AIG library was initialized or last cleared. Unlike AIG.GetError (which only shows the single most recent failure), this command provides the complete audit trail.

 

What is the GetErrorHistory Command?

 

It returns a multi-line string containing all recorded error messages. Each entry typically includes a timestamp, the internal function name, the error code, and the description.

 

Why Do You Need It?

 

This is essential for deep debugging:

Cascading Failures: Determine if a final "Network Error" was actually preceded by a "Payload Creation Error" earlier in the script.

Long-Running Scripts: Review what went wrong over a period of time without checking after every single command.

Logging: Dump the entire session state to a file for later analysis.

 

Example Usage

 

' ... run various AI operations ...

AIG.Ask|Query 1

AIG.Ask|Query 2

 

' Check the full log at the end

AIG.GetErrorHistory|$$LOG

 

' Save log to file for review

CTF.Log.txt|$$LOG

 

' Example Output in $$LOG:

' [10:00:01] [AIG:Initialize]: OK.

' [10:00:05] [AIG:CallAPI] Error (204): HTTP Transport Failed...

' [10:00:06] [AIG:ChatCompletion] Error (200): Analysis Failed...

 

Syntax

 

AIG.GetErrorHistory[|P1]

AIG.geh[|P1]

 

Parameter Explanation

 

P1 - (Optional) Variable name to store the full error log string. If omitted, the result is placed on the Top-Of-Stack (TOS).

 

Remarks

 

- The history log is maintained in memory. To prevent unlimited memory usage, the library may trim the oldest entries if the log exceeds a certain size (typically 8KB - 16KB).

- Use AIG.ClearError with parameter 1 to wipe this history.

 

See also:

 

? AIG.GetError

? AIG.ClearError