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 interface
Error response generated by the event handler. -
Method Summary
Modifier and TypeMethodDescriptionstatic ErrorResponseEventContext
create()
Creates anEventContext
already overlayed with this interface.Returns theServiceException
that caused the error being transformed into an error response.Returns theErrorResponseEventContext.ErrorResponse
with messages and target HTTP status.void
setException
(ServiceException exception) Sets theServiceException
that should be transformed into an error response.void
setResult
(ErrorResponseEventContext.ErrorResponse errorResponse) Sets theErrorResponseEventContext.ErrorResponse
with 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, put, setCompleted
-
Method Details
-
create
Creates anEventContext
already overlayed with this interface. The event is set to beApplicationLifecycleService.EVENT_ERROR_RESPONSE
- Returns:
- the
ErrorResponseEventContext
-
setException
Sets theServiceException
that should be transformed into an error response.- Parameters:
exception
- theServiceException
that should be transformed into an error response.
-
getException
ServiceException getException()Returns theServiceException
that caused the error being transformed into an error response.- Returns:
- the
ServiceException
that should be transformed into an error response.
-
setResult
Sets theErrorResponseEventContext.ErrorResponse
with messages and target HTTP status.- Parameters:
errorResponse
- theErrorResponseEventContext.ErrorResponse
with messages and target HTTP status.
-
getResult
ErrorResponseEventContext.ErrorResponse getResult()Returns theErrorResponseEventContext.ErrorResponse
with messages and target HTTP status.- Returns:
- the
ErrorResponseEventContext.ErrorResponse
with messages and target HTTP status.
-