Package org.openremote.container.web
Class WebServiceExceptions
java.lang.Object
org.openremote.container.web.WebServiceExceptions
Unified exception handling for all web services (Resteasy, Undertow, Servlets, WebSockets).
This is naturally quite messy, our goal is to disable all the other default exception handling and do it here in a "simple" way.
In production we want to be INFOrmed of exceptions but only log a stacktrace if FINE debug logging is enabled. We never want to send a stacktrace or some crappy HTML to a client in production.TODO: Fine-grained logging for exception, filter which should be logged at INFO or WARN in production TODO: Websocket session errors
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Throwablestatic ThrowablegetRootCause(Throwable throwable) static javax.ws.rs.core.ResponsehandleResteasyException(boolean devMode, String origin, javax.ws.rs.core.Request request, javax.ws.rs.core.UriInfo uriInfo, Throwable throwable) static voidhandleUndertowException(boolean devMode, String origin, boolean logOnly, io.undertow.server.HttpServerExchange exchange, Throwable throwable) static voidlogException(Throwable throwable, String origin, String info) static StringrenderDevModeError(int statusCode, Throwable t) static StringrenderProductionError(int statusCode, Throwable t)
-
Constructor Details
-
WebServiceExceptions
public WebServiceExceptions()
-
-
Method Details
-
handleResteasyException
-
handleUndertowException
-
renderDevModeError
-
renderProductionError
-
logException
-
getRootCause
-
getCause
-