public class ResourceException extends RuntimeException implements Error
Constructor and Description |
---|
ResourceException(Error error) |
Modifier and Type | Method and Description |
---|---|
List<ErrorCause> |
getCauses()
Returns the list of causes of this error.
|
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. |
Map<String,List<String>> |
getHeaders()
Returns the HTTP headers associated with this error response.
|
String |
getId()
Returns the error ID of this error.
|
int |
getStatus()
Returns this error's HTTP status code.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getMessage
public ResourceException(Error error)
public int getStatus()
Error
public String getCode()
public String getId()
Error
public List<ErrorCause> getCauses()
Error
public Map<String,List<String>> getHeaders()
Error
getHeaders
in interface Error
public Error getError()
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); }
Error
resource representation returned from the Okta API server.Copyright © 2017–2023 Okta. All rights reserved.