Add global option for error handler function