Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 11.0   11.1   11.2   11.3   11.4   11.5   12.0   12.1   12.2   12.3    Statistic    FMM    Blog  

AddToErrorLog

Adds log entry to current error log.

Component Version macOS Windows Linux Server iOS SDK License
Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes Free
MBS( "AddToErrorLog" )

Parameters

none

Result

Returns OK or error.

Description

Adds log entry to current error log.
Please pass JSON to be added to the error log managed by the MBS Plugin.
You may use ClearErrors function to clear error log on start of a script.

Examples

Sample custom function to add FileMaker error to our Error Log:

Let([
e = Get(LastError);
d = Get(LastExternalErrorDetail);
r = MBS("AddToErrorLog";
JSONSetElement ( "{}" ;
      [ "lastError" ; e; JSONNumber ] ;
      [ "lastErrorMessage" ; d; JSONString ] ;
      [ "scriptName" ; Get(ScriptName); JSONString ];
      [ "fileName" ; Get(FileName); JSONString ];
      [ "currentTimeStamp" ; Get(CurrentTimestamp); JSONString ]
))
]; e ≠ 0)

Catch various errors in MBS Plugin and in FileMaker:

Set Error Capture [ On ]
#
# start error logging
Set Variable [ $r ; Value: MBS("ClearErrors") ]
#
Loop
    #
    # cause some errors
    Set Variable [ $r ; Value: MBS("test"; 1; "Hello") ]
    Exit Loop If [ MBS("IsError") ]
    #
    Set Variable [ $r ; Value: MBS("DynaPDF.Print"; 1; "Hello") ]
    Exit Loop If [ MBS("IsError") ]
    #
    # FileMaker error
    Perform Script [ Specified: From list ; <unknown> ; Parameter: ]
    Exit Loop If [ CheckError ]
    #
    # here we are done and no error happend
    Exit Script [ Text Result: "Success" ]
End Loop
#
# now query error log
Set Variable [ $r ; Value: MBS("ErrorLog") ]
# and notice developer
Show Custom Dialog [ "Error Log" ; $r ]

See also

Created 23th June 2022, last changed 23th June 2022


AVRecorder.VideoResolutions - Addressbook.Account.Name

Feedback: Report problem or ask question.


Start Chat