Package com.sap.cds.services.application
Interface ErrorResponseEventContext.ErrorResponse
- Enclosing interface:
- ErrorResponseEventContext
public static interface ErrorResponseEventContext.ErrorResponse
extends com.sap.cds.CdsData
Error response generated by the event handler.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.sap.cds.CdsData
com.sap.cds.CdsData.Factory
-
Field Summary
Fields inherited from interface com.sap.cds.CdsData
factory
-
Method Summary
Modifier and TypeMethodDescriptioncreate()
Creates a new instance ofErrorResponseEventContext.ErrorResponse
.Returns the HTTP status to be used in the error response.Returns the list ofMessage
objects to be written in the error response.void
setHttpStatus
(Integer httpStatus) Sets the HTTP status to be used in the error response.void
setMessages
(List<Message> messages) Sets the list ofMessage
objects to be written in the error response.Methods inherited from interface com.sap.cds.CdsData
containsPath, forRemoval, forRemoval, get, getPath, getPathOrDefault, isForRemoval, putPath, putPathIfAbsent, removePath
Methods inherited from interface com.sap.cds.JSONizable
toJson
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Method Details
-
create
Creates a new instance ofErrorResponseEventContext.ErrorResponse
.- Returns:
- the instance of
ErrorResponseEventContext.ErrorResponse
.
-
getHttpStatus
Integer getHttpStatus()Returns the HTTP status to be used in the error response.- Returns:
- the HTTP status.
-
setHttpStatus
Sets the HTTP status to be used in the error response.- Parameters:
httpStatus
- the HTTP status to be used in the error response.
-
getMessages
Returns the list ofMessage
objects to be written in the error response.- Returns:
- the list of
Message
objects to be written in the error response.
-
setMessages
Sets the list ofMessage
objects to be written in the error response. The first message of the list will be used as the primary error in the response generated by the OData V2 and V4 protocol adapters.- Parameters:
messages
- the list ofMessage
objects to be written in the error response.
-