Constructor to create a GatewayErrorResponse object that accepts
errorCode and errorMessage.
Signature
global GatewayErrorResponse(String errorCode, String
errorMessage)
Parameters
- errorCode
- Type: String
- Should match with the HTTP status code to be returned to the user. Here are a few examples.
- If the status code is for a bad request, the errorCode should be 400.
- If the status code is for a forbidden request, errorCode should be 403.
- If errorCode isn’t a valid HTTP status code, a 500 internal server error is
returned.
- errorMessage
- Type: String
- The message response to users following an error.
-