Package de.pisa.psa.rst.obj
Klasse PsaRstApiErrFac
java.lang.Object
de.pisa.psa.rst.obj.PsaRstApiErrFac
REST API: error factory
- Seit:
- 21.06.2023
- Autor:
- weiland
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungConstructorPsaRstApiErrFac
(javax.ws.rs.core.Response.StatusType status) Constructor -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungadd a detailaddEventGid
(PsaRstApiEvtHdl handler) Add the event GID to the details.Add the event GID to the details.build a new error instance where the placeholders in the message ore replacedgetError()
Create a web exception
ClientErrorException if the response has a 4XX status
ServerErrorException if the response has a 5XX statusfinal PsaRstApiErrFac
setErrorCode
(String code) set the error codefinal PsaRstApiErrFac
setErrorMessage
(String message) set the error messagevoid
throw a web exceptiontoString()
-
Konstruktordetails
-
PsaRstApiErrFac
Constructor- Parameter:
code
- error code
-
PsaRstApiErrFac
public PsaRstApiErrFac(javax.ws.rs.core.Response.StatusType status) Constructor- Parameter:
status
- status code
-
-
Methodendetails
-
toString
-
setErrorCode
set the error code- Parameter:
code
- code- Gibt zurück:
- this
-
setErrorMessage
set the error message- Parameter:
message
- message- Gibt zurück:
- this
-
addDetail
add a detail- Parameter:
key
- keyvalue
- value- Gibt zurück:
- this
-
addEventGid
Add the event GID to the details. The key will be eventGid- Parameter:
handler
- event handler- Gibt zurück:
- this
-
addEventGid
Add the event GID to the details. The key will be eventGid- Parameter:
data
- event handler data- Gibt zurück:
- this
-
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.ServerErrorExceptionthrow a web exception- Löst aus:
javax.ws.rs.ClientErrorException
- if the response has a 4XX statusjavax.ws.rs.ServerErrorException
- if the response has a 5XX statusRuntimeException
- if the response has not a status of 4XX or 5XX
-
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
-