Class XMLFailureRenderer

java.lang.Object
com.peterphi.std.guice.web.rest.jaxrs.exception.XMLFailureRenderer
All Implemented Interfaces:
RestFailureRenderer
Direct Known Subclasses:
CustomTemplateFailureRenderer, HTMLFailureRenderer

public class XMLFailureRenderer extends Object implements RestFailureRenderer
A simple renderer that renders an XML form of the RestFailure object by letting the JAX-RS implementation serialise it
Sets the X-Rich-Exception flag so that our code can understand and intelligently reconstruct an exception client-side
  • Field Details

    • includeStackTrace

      @Inject(optional=true) public boolean includeStackTrace
    • stackTraceRequiresLoggedIn

      @Inject(optional=true) public boolean stackTraceRequiresLoggedIn
    • stackTraceWhenLoggedInRequiresAdminOrService

      @Inject(optional=true) public boolean stackTraceWhenLoggedInRequiresAdminOrService
  • Constructor Details

    • XMLFailureRenderer

      public XMLFailureRenderer()
  • Method Details

    • render

      public javax.ws.rs.core.Response render(RestFailure failure)
      Description copied from interface: RestFailureRenderer
      Allows user-defined code to present the exception in a more user-friendly manner
      Specified by:
      render in interface RestFailureRenderer
      Returns:
      a non-null Response if desired - otherwise (or if this method throws) the default exeption renderer will be used