def _set_error_handler_callbacks(self, app):
        """
        Sets the error handler callbacks used by this extension
        """
        @app.errorhandler(NoAuthorizationError)
        def handle_auth_error(e):
            return self._unauthorized_callback(str(e))

        @app.errorhandler(CSRFError)
        def handle_csrf_error(e):
            return self._unauthorized_callback(str(e))

        @app.errorhandler(ExpiredSignatureError)
        def handle_expired_error(e):
            try:
                token = ctx_stack.top.expired_jwt
                return self._expired_token_callback(token)
            except TypeError:
                msg = (
                    "jwt.expired_token_loader callback now takes the expired token "
                    "as an additional paramter. Example: expired_callback(token)"
                )
                warn(msg, DeprecationWarning)
                return self._expired_token_callback()

        @app.errorhandler(InvalidHeaderError)
        def handle_invalid_header_error(e):
            return self._invalid_token_callback(str(e))

        @app.errorhandler(InvalidTokenError)
        def handle_invalid_token_error(e):
            return self._invalid_token_callback(str(e))

        @app.errorhandler(JWTDecodeError)
        def handle_jwt_decode_error(e):
            return self._invalid_token_callback(str(e))

        @app.errorhandler(WrongTokenError)
        def handle_wrong_token_error(e):
            return self._invalid_token_callback(str(e))

        @app.errorhandler(InvalidAudienceError)
        def handle_invalid_audience_error(e):
            return self._invalid_token_callback(str(e))

        @app.errorhandler(RevokedTokenError)
        def handle_revoked_token_error(e):
            return self._revoked_token_callback()

        @app.errorhandler(FreshTokenRequired)
        def handle_fresh_token_required(e):
            return self._needs_fresh_token_callback()

        @app.errorhandler(UserLoadError)
        def handler_user_load_error(e):
            # The identity is already saved before this exception was raised,
            # otherwise a different exception would be raised, which is why we
            # can safely call get_jwt_identity() here
            identity = get_jwt_identity()
            return self._user_loader_error_callback(identity)

        @app.errorhandler(UserClaimsVerificationError)
        def handle_failed_user_claims_verification(e):
            return self._verify_claims_failed_callback()
def _set_error_handler_callbacks ( self , app ) : @ app . errorhandler ( NoAuthorizationError ) def handle_auth_error ( e ) : return self . _unauthorized_callback ( str ( e ) ) @ app . errorhandler ( CSRFError ) def handle_csrf_error ( e ) : return self . _unauthorized_callback ( str ( e ) ) @ app . errorhandler ( ExpiredSignatureError ) def handle_expired_error ( e ) : try : token = ctx_stack . top . expired_jwt return self . _expired_token_callback ( token ) except TypeError : msg = ( "jwt.expired_token_loader callback now takes the expired token " "as an additional paramter. Example: expired_callback(token)" ) warn ( msg , DeprecationWarning ) return self . _expired_token_callback ( ) @ app . errorhandler ( InvalidHeaderError ) def handle_invalid_header_error ( e ) : return self . _invalid_token_callback ( str ( e ) ) @ app . errorhandler ( InvalidTokenError ) def handle_invalid_token_error ( e ) : return self . _invalid_token_callback ( str ( e ) ) @ app . errorhandler ( JWTDecodeError ) def handle_jwt_decode_error ( e ) : return self . _invalid_token_callback ( str ( e ) ) @ app . errorhandler ( WrongTokenError ) def handle_wrong_token_error ( e ) : return self . _invalid_token_callback ( str ( e ) ) @ app . errorhandler ( InvalidAudienceError ) def handle_invalid_audience_error ( e ) : return self . _invalid_token_callback ( str ( e ) ) @ app . errorhandler ( RevokedTokenError ) def handle_revoked_token_error ( e ) : return self . _revoked_token_callback ( ) @ app . errorhandler ( FreshTokenRequired ) def handle_fresh_token_required ( e ) : return self . _needs_fresh_token_callback ( ) @ app . errorhandler ( UserLoadError ) def handler_user_load_error ( e ) : identity = get_jwt_identity ( ) return self . _user_loader_error_callback ( identity ) @ app . errorhandler ( UserClaimsVerificationError ) def handle_failed_user_claims_verification ( e ) : return self . _verify_claims_failed_callback ( )
Sets the error handler callbacks used by this extension