Class ResourceException

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<ErrorCause> getCauses()
      Returns the list of causes of this error.
      java.lang.String getCode()
      Get the Okta Error Code, click here for the list of Okta error codes.
      Error getError()
      Returns the underlying REST Error returned from the Okta API server.
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getHeaders()
      Returns the HTTP headers associated with this error response.
      java.lang.String getId()
      Returns the error ID of this error.
      int getStatus()
      Returns this error's HTTP status code.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ResourceException

        public ResourceException​(Error error)
    • Method Detail

      • getStatus

        public int getStatus()
        Description copied from interface: Error
        Returns this error's HTTP status code.
        Specified by:
        getStatus in interface Error
        Returns:
        the status code of this Error
      • getCode

        public java.lang.String getCode()
        Get the Okta Error Code, click here for the list of Okta error codes.
        Specified by:
        getCode in interface Error
        Returns:
        the code of the error
      • getId

        public java.lang.String getId()
        Description copied from interface: Error
        Returns the error ID of this error. This maybe used when opening a support case and troubleshooting.
        Specified by:
        getId in interface Error
        Returns:
        error ID of this error
      • getCauses

        public java.util.List<ErrorCause> getCauses()
        Description copied from interface: Error
        Returns the list of causes of this error. When validating a resource (for example a User) multiple validation errors could occur.
        Specified by:
        getCauses in interface Error
        Returns:
        A list of causes, which could be {code}null{code} or empty
      • getHeaders

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getHeaders()
        Description copied from interface: Error
        Returns the HTTP headers associated with this error response.
        Specified by:
        getHeaders in interface Error
        Returns:
        A list headers, which could be {code}null{code} or empty
      • getError

        public Error getError()
        Returns the underlying REST Error returned from the Okta API server.

        Because this class's getMessage() value returns a developer-friendly message to help you debug when you see stack traces, you might want to acquire the underlying Error to show an end-user the simpler end-user appropriate error message. The end-user error message is non-technical in nature - as a convenience, you can show this message directly to your application end-users.

        For example:

         try {
        
             //something that causes a ResourceException
        
         } catch (ResourceException re) {
        
             String endUserMessage = re.getError().getMessage();
        
             warningDialog.setText(endUserMessage);
         }
         
        Returns:
        the underlying REST Error resource representation returned from the Okta API server.