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 class
static class
static class
static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Throwable
static Throwable
getRootCause
(Throwable throwable) static jakarta.ws.rs.core.Response
handleResteasyException
(boolean devMode, String origin, jakarta.ws.rs.core.Request request, jakarta.ws.rs.core.UriInfo uriInfo, Throwable throwable) static void
handleUndertowException
(boolean devMode, String origin, boolean logOnly, io.undertow.server.HttpServerExchange exchange, Throwable throwable) static void
logException
(Throwable throwable, String origin, String info) static String
renderDevModeError
(int statusCode, Throwable t) static String
renderProductionError
(int statusCode, Throwable t)
-
Constructor Details
-
WebServiceExceptions
public WebServiceExceptions()
-
-
Method Details
-
handleResteasyException
-
handleUndertowException
-
renderDevModeError
-
renderProductionError
-
logException
-
getRootCause
-
getCause
-