A Factory of Exceptions that may be thrown by scripts. Using this factory makes it easier for scripts to throw Java Exceptions that are recognized by the system.

Hierarchy

  • ScriptExceptionFactory

Methods

  • Create a bad-request Java Exception

    Parameters

    • errorCode: string
    • message: string

    Returns Error

  • Create a bad-request Java Exception

    Parameters

    • message: string

    Returns Error

  • Create a bad-request Java Exception

    Returns Error

  • Create a generic error Java Exception.

    Returns

    a Java Exception with the 500 status code and an errorKey which can be used by module-specific handlers to identify special errors thrown by scripts.

    For example, the OAuth module uses this method in default scripts to allow the OAuthTokenProcedureRunner class to return a OAuth error_code and error message determined by the token procedure.

    Parameters

    • errorCode: string

      that might be interpreted by the handler class in order to provide module-specific error handling behaviour. Mapped to se.curity.identityserver.errors.SystemRuntimeException#_errorCode.

    • message: string

      error message.

    Returns Error

  • Create an forbidden Java Exception

    Parameters

    • message: string

    Returns Error

  • Create an internal-server-error Java Exception

    Returns Error

  • Create an internal-server-error Java Exception

    Parameters

    • message: string

    Returns Error

  • Create a not-found-error Java Exception

    Returns Error

  • Create a redirect Java Exception. Redirects a request to another location. The status code that is used when redirecting is 302, Moved Temporarily.

    Parameters

    • redirectUri: string

      the URI of the location to be redirected to.

    Returns Error

  • Create a redirect Java Exception. Redirects a request to another location using a certain status code. It is an error to use a status code outside the [300..400] range.

    Parameters

    • redirectUri: string

      the URI of the location to be redirected to.

    • redirectStatusCode: number

    Returns Error

  • Create a redirect Java Exception. Redirects a request to another location. The status code that is used when redirecting is 302, Moved Temporarily.

    Deprecated

    setting the message has been deprecated. Use redirectException(string) instead.

    Deprecated

    Parameters

    • message: string

      an unused value that will be ignored

    • redirectUri: string

      the URI of the location to be redirected to.

    Returns Error

  • Redirects a request to another location, adding parameters to the query string of that URI.

    Returns

    an exception that can be thrown to redirect to the given URI

    Deprecated

    setting the message and the query string arguments has been deprecated. Use redirectException(string) instead, passing the query string arguments in the redirectUri parameter.

    Deprecated

    Parameters

    • message: string

      an unused value that will be ignored

    • redirectUri: string

      the URI of the location to be redirected to

    • queryParameters: any

      a map of query string parameters to add to the redirect URI or [null] if none should be added

    Returns Error

  • Create a service-unavailable-error Java Exception

    Returns Error

  • Create an unauthorized Java Exception

    Parameters

    • message: string

    Returns Error

  • Create an unauthorized Java Exception

    Parameters

    • message: string
    • realm: string

    Returns Error