Package com.oracle.bmc.model
Class BmcException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.oracle.bmc.model.BmcException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AuthClientException,AuthServerException
public class BmcException extends RuntimeException
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringOPC_REQUEST_ID_HEADERName of the header that contains the request id.
-
Constructor Summary
Constructors Constructor Description BmcException(boolean timeout, String message, Throwable cause, String opcRequestId)BmcException(int statusCode, String serviceCode, String message, String opcRequestId)BmcException(int statusCode, String serviceCode, String message, String opcRequestId, ServiceDetails serviceDetails)BmcException(int statusCode, String serviceCode, String message, String opcRequestId, ServiceDetails serviceDetails, String originalMessage, String originalMessageTemplate, Map<String,String> templateArguments)BmcException(int statusCode, String serviceCode, String message, String opcRequestId, Throwable cause)BmcException(int statusCode, String serviceCode, String message, String opcRequestId, Throwable cause, ServiceDetails serviceDetails)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetMessage()Map<String,String>getMessageArguments()Gets the template arguments of the failed Exception. null in the case of non-localized responses.StringgetOpcRequestId()The opc-request-id header returned by the service that should be provided for support requests.StringgetOriginalMessage()Gets the original message of the failed Exception. null in the case of non-localized responses.StringgetOriginalMessageTemplate()Gets the original message template of the failed Exception. null in the case of non-localized responses.StringgetServiceCode()Service specific code returned.ServiceDetailsgetServiceDetails()Gets the service details of the failed Exception. null in the case of client-side exceptionsintgetStatusCode()The HTTP status code.StringgetUnmodifiedMessage()Returns the exception message, without adding additional troubleshooting information to it.booleanisClientSide()Flag to indicate that the exception originated from the client and not from the service.booleanisTimeout()Flag to indicate that the request timed out.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
OPC_REQUEST_ID_HEADER
public static final String OPC_REQUEST_ID_HEADER
Name of the header that contains the request id.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BmcException
public BmcException(int statusCode, String serviceCode, String message, String opcRequestId, Throwable cause)
-
BmcException
public BmcException(int statusCode, String serviceCode, String message, String opcRequestId, Throwable cause, ServiceDetails serviceDetails)
-
BmcException
public BmcException(int statusCode, String serviceCode, String message, String opcRequestId)
-
BmcException
public BmcException(int statusCode, String serviceCode, String message, String opcRequestId, ServiceDetails serviceDetails)
-
BmcException
public BmcException(boolean timeout, String message, Throwable cause, String opcRequestId)
-
-
Method Detail
-
getMessage
public String getMessage()
- Overrides:
getMessagein classThrowable
-
getUnmodifiedMessage
public String getUnmodifiedMessage()
Returns the exception message, without adding additional troubleshooting information to it.- Returns:
- unmodified exception message
-
getStatusCode
public int getStatusCode()
The HTTP status code.
-
getServiceCode
public String getServiceCode()
Service specific code returned.Null if the client timed out or failed to get a response from the service.
-
isTimeout
public boolean isTimeout()
Flag to indicate that the request timed out.Status code and service code should not be used if this is true.
-
getOpcRequestId
public String getOpcRequestId()
The opc-request-id header returned by the service that should be provided for support requests.If the client timed out or failed to get a response from the service, then this is the outbound request id, i.e. either the value for the
OPC_REQUEST_ID_HEADERheader set by the caller in an invocation callback, or otherwise a value automatically generated by the SDK.
-
isClientSide
public boolean isClientSide()
Flag to indicate that the exception originated from the client and not from the service.Status code and service code should not be used if this is true.
-
getServiceDetails
public ServiceDetails getServiceDetails()
Gets the service details of the failed Exception. null in the case of client-side exceptions
-
getOriginalMessage
public String getOriginalMessage()
Gets the original message of the failed Exception. null in the case of non-localized responses.
-
getOriginalMessageTemplate
public String getOriginalMessageTemplate()
Gets the original message template of the failed Exception. null in the case of non-localized responses.
-
-