Class ErrorHandler


  • public class ErrorHandler
    extends java.lang.Object
    Maps exceptions to status codes for sending over the wire.
    • Constructor Detail

      • ErrorHandler

        public ErrorHandler()
      • ErrorHandler

        public ErrorHandler​(boolean includeServerErrors)
        Parameters:
        includeServerErrors - Whether to include server-side details in thrown exceptions if the information is available.
      • ErrorHandler

        public ErrorHandler​(ErrorCodes codes,
                            boolean includeServerErrors)
        Parameters:
        includeServerErrors - Whether to include server-side details in thrown exceptions if the information is available.
        codes - The ErrorCodes object to use for linking error codes to exceptions.
    • Method Detail

      • isIncludeServerErrors

        public boolean isIncludeServerErrors()
      • setIncludeServerErrors

        public void setIncludeServerErrors​(boolean includeServerErrors)
      • throwIfResponseFailed

        public Response throwIfResponseFailed​(Response response,
                                              long duration)
                                       throws java.lang.RuntimeException
        Throws:
        java.lang.RuntimeException