RaiseOnError(f)
This is useful if you do not want to use Hollywood's inbuilt automatic error handler. Please note that in certain situations the name of the last command and the current line number can be wrong.
Also note that if an error occurs in your custom error handling function, Hollywood will exit with a fatal error. Thus, you should keep the custom error handler as brief and straight-forward as possible.
To uninstall your custom error handler, simply pass Nil
in the f
argument.
See Error codes for a list of all error codes defined by Hollywood.
Function p_ErrorFunc(code, msg$, cmd$, line) DebugPrint(code, msg$, cmd$, line) EndFunction RaiseOnError(p_ErrorFunc) LoadBrush(1, "non_existing_brush.png")The code above installs a custom error function and then tries to load a non-existing brush. This leads to the error function being called and further information will be printed to the debug device.