You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Framework user reports an incorrect behavior when a Status object is created, and the status and its associated description are not found in the status.yml file
The text was updated successfully, but these errors were encountered:
There is an exception happens when the framework tries to construct a Status object from status.yml config file. What would be the best approach to handle this scenario?
Create another error code to indicate that a specific status code is missing from status.yml?
Just log it as an error in the stdout and log file?
A default method has been added into MiddlewareHandler interface to setExchangeStatus. If the status code is not loaded successfully from status.yml file, then an ERROR_NOT_DEFINED will be returned.
default void setExchangeStatus(HttpServerExchange exchange, String code, final Object... args) {
Status status = new Status(code, args);
if(status.getStatusCode() == 0) {
// There is no entry in status.yml for this particular error code.
status = new Status(ERROR_NOT_DEFINED, code);
}
exchange.setStatusCode(status.getStatusCode());
exchange.getResponseSender().send(status.toString());
logger.error(status.toString());
}
Framework user reports an incorrect behavior when a Status object is created, and the status and its associated description are not found in the status.yml file
The text was updated successfully, but these errors were encountered: