ocpp-rpc
    Preparing search index...

    Function createRPCError

    • Creates an RPCError which can be thrown from a call handler to return a non-generic error response.

      Type Description
      GenericError A generic error when no more specific error is appropriate.
      NotImplemented Requested method is not known.
      NotSupported Requested method is recognised but not supported.
      InternalError An internal error occurred and the receiver was not able to process the requested method successfully.
      ProtocolError Payload for method is incomplete.
      SecurityError During the processing of method a security issue occurred preventing receiver from completing the method successfully.
      FormatViolation Payload for the method is syntactically incorrect or not conform the PDU structure for the method.
      FormationViolation (Deprecated) Same as FormatViolation. Retained for backwards compatibility with OCPP 1.6 and below.
      PropertyConstraintViolation Payload is syntactically correct but at least one field contains an invalid value.
      OccurrenceConstraintViolation Payload for the method is syntactically correct but at least one of the fields violates occurrence constraints.
      OccurenceConstraintViolation (Deprecated) Same as OccurrenceConstraintViolation. Retained for backwards compatibility with OCPP 1.6 and below.
      TypeConstraintViolation Payload for the method is syntactically correct but at least one of the fields violates data type constraints.
      MessageTypeNotSupported A message with a Message Type Number received is not supported by this implementation.
      RpcFrameworkError Content of the call is not a valid RPC Request, for example: MessageId could not be read.

      Parameters

      • type:
            | "GenericError"
            | "NotImplemented"
            | "NotSupported"
            | "InternalError"
            | "ProtocolError"
            | "SecurityError"
            | "FormatViolation"
            | "FormationViolation"
            | "PropertyConstraintViolation"
            | "OccurenceConstraintViolation"
            | "OccurrenceConstraintViolation"
            | "TypeConstraintViolation"
            | "MessageTypeNotSupported"
            | "RpcFrameworkError"

        The OCPP-J RPC error type (see table above).

      • Optionalmessage: string

        The error's message.

      • Optionaldetails: Record<string, any> = {}

        The details object to pass along with the error.

      Returns RPCError