Klasse PsaRstApiErrFac

java.lang.Object
de.pisa.psa.rst.obj.PsaRstApiErrFac

public class PsaRstApiErrFac extends Object
REST API: error factory
Seit:
21.06.2023
Autor:
weiland
  • Konstruktordetails

    • PsaRstApiErrFac

      public PsaRstApiErrFac(PsaRstApiErrCod code)
      Constructor
      Parameter:
      code - error code
    • PsaRstApiErrFac

      public PsaRstApiErrFac(javax.ws.rs.core.Response.StatusType status)
      Constructor
      Parameter:
      status - status code
  • Methodendetails

    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
      Siehe auch:
    • setErrorCode

      public final PsaRstApiErrFac setErrorCode(String code)
      set the error code
      Parameter:
      code - code
      Gibt zurück:
      this
    • setErrorMessage

      public final PsaRstApiErrFac setErrorMessage(String message)
      set the error message
      Parameter:
      message - message
      Gibt zurück:
      this
    • addDetail

      public PsaRstApiErrFac addDetail(String key, String value)
      add a detail
      Parameter:
      key - key
      value - value
      Gibt zurück:
      this
    • addEventGid

      public PsaRstApiErrFac addEventGid(PsaRstApiEvtHdl handler)
      Add the event GID to the details. The key will be eventGid
      Parameter:
      handler - event handler
      Gibt zurück:
      this
    • addEventGid

      public PsaRstApiErrFac addEventGid(PsaRstApiEvtHdlDat data)
      Add the event GID to the details. The key will be eventGid
      Parameter:
      data - event handler data
      Gibt zurück:
      this
    • buildError

      public PsaRstApiErr buildError()
      build a new error instance where the placeholders in the message ore replaced
      Gibt zurück:
      error
    • throwError

      public void throwError() throws javax.ws.rs.ClientErrorException, javax.ws.rs.ServerErrorException
      throw a web exception
      Löst aus:
      javax.ws.rs.ClientErrorException - if the response has a 4XX status
      javax.ws.rs.ServerErrorException - if the response has a 5XX status
      RuntimeException - if the response has not a status of 4XX or 5XX
    • getError

      public RuntimeException getError()
      Create a web exception
      ClientErrorException if the response has a 4XX status
      ServerErrorException if the response has a 5XX status
      Gibt zurück:
      exception