Package com.sap.cds.services.application
Interface ErrorResponseEventContext
- All Superinterfaces:
EventContext
EventContext for the event ApplicationLifecycleService.EVENT_ERROR_RESPONSE, that
allows to handle transformation of exceptions and messages to an error response-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceError response generated by the event handler. -
Method Summary
Modifier and TypeMethodDescriptionstatic ErrorResponseEventContextcreate()Creates anEventContextalready overlayed with this interface.Returns theServiceExceptionthat caused the error being transformed into an error response.Returns theErrorResponseEventContext.ErrorResponsewith messages and target HTTP status.voidsetException(ServiceException exception) Sets theServiceExceptionthat should be transformed into an error response.voidsetResult(ErrorResponseEventContext.ErrorResponse errorResponse) Sets theErrorResponseEventContext.ErrorResponsewith messages and target HTTP status.Methods inherited from interface com.sap.cds.services.EventContext
as, get, getAuthenticationInfo, getCdsRuntime, getChangeSetContext, getEvent, getFeatureTogglesInfo, getMessages, getModel, getParameterInfo, getService, getServiceCatalog, getTarget, getUserInfo, isCompleted, keySet, proceed, put, setCompleted
-
Method Details
-
create
Creates anEventContextalready overlayed with this interface. The event is set to beApplicationLifecycleService.EVENT_ERROR_RESPONSE- Returns:
- the
ErrorResponseEventContext
-
setException
Sets theServiceExceptionthat should be transformed into an error response.- Parameters:
exception- theServiceExceptionthat should be transformed into an error response.
-
getException
ServiceException getException()Returns theServiceExceptionthat caused the error being transformed into an error response.- Returns:
- the
ServiceExceptionthat should be transformed into an error response.
-
setResult
Sets theErrorResponseEventContext.ErrorResponsewith messages and target HTTP status.- Parameters:
errorResponse- theErrorResponseEventContext.ErrorResponsewith messages and target HTTP status.
-
getResult
ErrorResponseEventContext.ErrorResponse getResult()Returns theErrorResponseEventContext.ErrorResponsewith messages and target HTTP status.- Returns:
- the
ErrorResponseEventContext.ErrorResponsewith messages and target HTTP status.
-