6.5.1. HTTP Messaging Error Control Handler

This handler catches exceptions and errors that occur in subsequent handlers, performs log output and generates response according to the exceptions (errors). If the response body is not configured in the subsequent handler, configures the default body corresponding to the HTTP status code in the response.

This handler performs the following processes:

The process flow is as follows.

../../../../_images/flow9.png Module list

</dependency> Constraints

Place this handler after the HTTP Response Handler
HttpResponse generated by this handler is processed by the HTTP Response Handler. Therefore, it is necessary that this handler is configured after the HTTP Response Handler. Processes the log output and generates response according to the exception type

Log level:INFO
Description:It is recorded as a trace log since it means that the handler to process the request is not available. The HTTP status code generates a response of 404, which means that there was no action class to process.
Log level:No log output
Description:Log is not output because it means that a business exception (exception as a result of validation, etc.) was raised in a subsequent handler.
Log level:Depends on the configuration
Description:Sed Log output of nablarch.fw.Result.Error.
nablarch.core.message.ApplicationException and nablarch.fw.messaging.MessagingException
Log level:-
Description:The HTTP status code generates a response of 400 because of an exception indicating that the request from the client is incorrect.
Exceptions and errors other than the above
Log level:FATAL
Description:For exceptions and errors that do not correspond to the above, log is output as a failure. The response is 500 because it is an unexpected exception or error. Log output of nablarch.fw.Result.Error

If the exception raised in the subsequent handler is Error, then whether to output the log changes depending on the value configured in writeFailureLogPattern. A regular expression can be configured to this property, and if the regular expression matches Error#getStatusCode(), a FATAL level log is output.