Package com.okta.sdk.error
Class ResourceException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.okta.sdk.error.ResourceException
- All Implemented Interfaces:
Error
,Serializable
- Direct Known Subclasses:
RetryableException
A Runtime exception typically thrown when the remote server returns a non 20x response.
- Since:
- 0.5.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of causes of this error.getCode()
Get the Okta Error Code, click here for the list of Okta error codes.getError()
Returns the underlying RESTError
returned from the Okta API server.Returns the HTTP headers associated with this error response.getId()
Returns the error ID of this error.int
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
Methods inherited from interface com.okta.sdk.error.Error
getMessage
-
Constructor Details
-
ResourceException
-
-
Method Details
-
getStatus
public int getStatus()Description copied from interface:Error
Returns this error's HTTP status code. -
getCode
Get the Okta Error Code, click here for the list of Okta error codes. -
getId
Description copied from interface:Error
Returns the error ID of this error. This maybe used when opening a support case and troubleshooting. -
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. -
getHeaders
Description copied from interface:Error
Returns the HTTP headers associated with this error response.- Specified by:
getHeaders
in interfaceError
- Returns:
- A list headers, which could be {code}null{code} or empty
-
getError
Returns the underlying RESTError
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 underlyingError
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.
-