Add support for error and exception handler registration