I don't know a situation where an error handler would make much sense. Errors are caused either by bugs in the script, or by wrong external files. Bugs in the script must be fixed; an error handling function won't help better than the error message. Script crashes are caught with the C++ "try/catch" mechanism, which won't give you more info about the crash as you already have in the error message.
Wrong or missing external files normally won't cause an error message unless they are essential for continuing the program. Otherwise, the function using them just returns an error value, usually 0, that you can evaluate in the script. A general error handler for this type of errors will tell you less than when you evaluate the return values.