Class representing an error from the Vattenfall service. Extends the native Error class and adds additional properties and methods to handle specific error scenarios related to the Vattenfall service.

Hierarchy

  • Error
    • VattenfallServiceError

Constructors

Properties

Holds the ErrorReport returned by the server.

message: string
name: string
stack?: string
status_code?: StatusCode

Represents the StatusCode provided by the server.

prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number

Accessors

  • get error_code(): undefined | string
  • Retrieves the error code associated with the current instance.

    Returns undefined | string

    The error code if available, otherwise undefined.

  • get technical_description(): undefined | string
  • Retrieves the technical description from the data object, if available.

    Returns undefined | string

    The technical description or undefined if it is not present.

  • get user_description(): undefined | string
  • Retrieves the user description.

    Returns undefined | string

    The user description if available, otherwise undefined.

Methods

  • Checks if the error code indicates that the terms of use have not been accepted.

    Returns boolean

    True if the error code is "ERROR_NUTZUNGSBEDINGUNGEN_BESTAETIGUNG_ERFORDERLICH", otherwise false.

  • Checks if the current error instance is due to a token expiration.

    This method verifies if the error is associated with an access denial caused by an expired token. It does this by checking if the status_code is "ACCESS_DENIED" and if the Code attribute within the data object is "ERROR_TOKEN_EXPIRED".

    Returns boolean

    True if the error is due to an expired token, false otherwise.

  • Checks if the current error status code indicates a user error.

    Returns boolean

    True if the status code is "USER_ERROR", otherwise false.

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void