Add error handlers (on_error and on_default_error).