Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
ErrorLog
Queries error log.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Plugin | 12.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
none
Result
Returns JSON or error.
Description
Queries error log.Error log gets activated with ClearErrors, which also clears all entries.
Please call ClearErrors function on beginning of a script and then on the end of the script, use HadErrors function to check if there was a problem. Use this function to query JSON with error details.
Querying the error log using ErrorLog function turns it off until the next call to ClearErrors function. You can add own entries with AddToErrorLog function.
Errors are tracked per thread, so on a server each PSoS session has its own error log. And it includes errors from subscripts.
Our error log is in addition to trace functions and Plugin.SetErrorScriptTrigger function.
Examples
Try the error log:
# test Errors in file Kontakte
# start error logging
Set Variable [ $r ; Value: MBS("ClearErrors") ]
#
# cause some errors
Set Variable [ $r ; Value: MBS("test"; 1; "Hello") ]
Set Variable [ $r ; Value: MBS("DynaPDF.Print"; 1; "Hello") ]
#
# now query error log
Set Variable [ $r ; Value: MBS("ErrorLog") ]
Show Custom Dialog [ "Error Log" ; $r ]
Example result:
[
{
"function": "test",
"result": "[MBS] Unknown function: test",
"parameter": ["test", 1, "Hello"],
"fileName": "Kontakte",
"scriptName": "test Errors",
"currentTimeStamp": "23.06.2022 09:28:34"
},
{
"function": "DynaPDF.Print",
"result": "[MBS] DynaPDF.Print is only supported for Windows. Please use PDFKit.Print on Mac.",
"parameter": [
"DynaPDF.Print",
1,
"Hello"
],
"fileName": "Kontakte",
"scriptName": "test Errors",
"currentTimeStamp": "23.06.2022 09:28:34"
}
]
See also
Release notes
- Version 12.3
- Added ErrorLog function to query JSON of errors from function calls in MBS FileMaker Plugin since last call to ClearErrors function.
Blog Entries
- MBS @ FMTraining.TV - The FileMaker MonkeyBread Plug-in Q&A
- MBS @ FMTraining.TV - Error Capturing with the MBS Plugin - FileMaker MBS Q&A
- Control printing in FileMaker with MBS Plugin on Windows
- FileMaker and MongoDB
- Top 10 from the MBS Plugin in 2022
- MBS Plugin 12.4 for Claris FileMaker
- MBS FileMaker Plugin 12.3
- MBS Plugin 12.3 for Claris FileMaker
- New error log functions for FileMaker
- Looping over records in FileMaker with error checking
This function is free to use.
Created 23th June 2022, last changed 14th March 2024