|
Custom error handling |
Top Previous Next |
|
You may add custom error handling functions which will catch script licensing errors. Error handler should be a function which accepts two parameters:
sg_error_handler( code , message )
You may use any name for this function. Also you may have different functions for different script errors. The first argument will contain a error code. The second one will contain a default error message.
Custom error handler function should be defined before an error may occur. The best place for it is in "prepend header" code as it's loaded *before* any license checking is done and so error handler will be always available if defined here. But you may also define a custom error handler function in another encoded file which will be included before the script which may cause a license error. Don't put any passwords etc secret data if you use a "prepend header" code for defining a error handler as this code is stored unencoded.
|