Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

AddToErrorLog

Adds log entry to current error log.

Component Version macOS Windows Linux Server iOS SDK
Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "AddToErrorLog"; JSON )   More

Parameters

Parameter Description Example
JSON The error as JSON. "{\"error\": \"Test\"}"

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:

// AddFileMakerErrorToLog(context) custom function
Let([
e = Get( LastError );
d = Get( LastErrorDetail );
r = MBS("AddToErrorLog";
JSONSetElement ( "{}" ;
            [ "context" ; context; JSONString ] ;
            [ "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

Release notes

  • Version 12.3

Blog Entries

This function is free to use.

Created 23th June 2022, last changed 14th March 2024


AVRecorder.VideoResolutions - Addressbook.Account.Name