Skip to content

Commit

Permalink
[RESTEASY-1507]
Browse files Browse the repository at this point in the history
Internationalize new messages in resteasy-spring.
  • Loading branch information
ronsigal authored and asoldano committed Feb 23, 2017
1 parent fbdbaae commit e5c44e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Expand Up @@ -48,6 +48,12 @@ public interface Messages
@Message(id = BASE + 40, value = "Interrupted while starting up Jetty")
String interruptedStartingUpJetty();

@Message(id = BASE + 42, value = "Not allowed")
String notAllowed();

@Message(id = BASE + 43, value = "Not supported")
String notSupported();

@Message(id = BASE + 45, value = "%s is not initial request. Its suspended and retried. Aborting.")
String pathNotInitialRequest(String path);

Expand All @@ -60,6 +66,9 @@ public interface Messages
@Message(id = BASE + 60, value = "RESTeasy Registry is null, do you have the ResteasyBootstrap listener configured?")
String registryIsNull();

@Message(id = BASE + 62, value = "The requested media type is not acceptable.")
String requestedMediaNotAcceptable();

@Message(id = BASE + 65, value = "ResourceFailure: %s")
String resourceFailure(String message);

Expand Down
Expand Up @@ -99,15 +99,15 @@ public HandlerExecutionChain getHandler(HttpServletRequest request)
LogMessages.LOGGER.error(Messages.MESSAGES.resourceNotFound(e.getMessage()), e);
}
catch (NotAcceptableException na) {
requestWrapper.setError(HttpResponseCodes.SC_NOT_ACCEPTABLE, "The requested media type is not acceptable.");
requestWrapper.setError(HttpResponseCodes.SC_NOT_ACCEPTABLE, Messages.MESSAGES.requestedMediaNotAcceptable());
return new HandlerExecutionChain(requestWrapper, interceptors);
}
catch (NotAllowedException na) {
requestWrapper.setError(HttpResponseCodes.SC_METHOD_NOT_ALLOWED, "Not allowed");
requestWrapper.setError(HttpResponseCodes.SC_METHOD_NOT_ALLOWED, Messages.MESSAGES.notAllowed());
return new HandlerExecutionChain(requestWrapper, interceptors);
}
catch (NotSupportedException nse) {
requestWrapper.setError(HttpResponseCodes.SC_UNSUPPORTED_MEDIA_TYPE, "Not supported");
requestWrapper.setError(HttpResponseCodes.SC_UNSUPPORTED_MEDIA_TYPE, Messages.MESSAGES.notSupported());
return new HandlerExecutionChain(requestWrapper, interceptors);
}
catch (Failure e)
Expand Down

0 comments on commit e5c44e6

Please sign in to comment.