Package com.oracle.bmc.model
Class BmcException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.oracle.bmc.model.SdkRuntimeException
-
- com.oracle.bmc.model.BmcException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AuthClientException
,AuthServerException
public class BmcException extends SdkRuntimeException
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
OPC_REQUEST_ID_HEADER
Name 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> messageArguments)
BmcException(int statusCode, String serviceCode, String message, String opcRequestId, ServiceDetails serviceDetails, String originalMessage, String originalMessageTemplate, Map<String,String> messageArguments, Map<String,String> additionalProperties)
BmcException(int statusCode, String serviceCode, String message, String opcRequestId, Throwable cause)
BmcException(int statusCode, String serviceCode, String message, String opcRequestId, Throwable cause, ServiceDetails serviceDetails)
BmcException(String message, Throwable cause, int statusCode, String serviceCode, boolean timeout, String opcRequestId, boolean isClientSide, ServiceDetails serviceDetails, String originalMessage, String originalMessageTemplate, Map<String,String> messageArguments)
BmcException(String message, Throwable cause, int statusCode, String serviceCode, boolean timeout, String opcRequestId, boolean isClientSide, ServiceDetails serviceDetails, String originalMessage, String originalMessageTemplate, Map<String,String> messageArguments, Map<String,String> additionalProperties)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BmcException
createClientSide(String message, Throwable cause, String opcRequestId, ServiceDetails serviceDetails)
Map<String,String>
getAdditionalProperties()
Gets the unknown attributes of the failed Exception.String
getMessage()
Map<String,String>
getMessageArguments()
Gets the template arguments of the failed Exception.String
getOpcRequestId()
The opc-request-id header returned by the service that should be provided for support requests.String
getOriginalMessage()
Gets the original message of the failed Exception.String
getOriginalMessageTemplate()
Gets the original message template of the failed Exception.String
getServiceCode()
Service specific code returned.ServiceDetails
getServiceDetails()
Gets the service details of the failed Exception.int
getStatusCode()
The HTTP status code.String
getUnmodifiedMessage()
Returns the exception message, without adding additional troubleshooting information to it.boolean
isClientSide()
Flag to indicate that the exception originated from the client and not from the service.boolean
isTimeout()
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(int statusCode, String serviceCode, String message, String opcRequestId, ServiceDetails serviceDetails, String originalMessage, String originalMessageTemplate, Map<String,String> messageArguments)
-
BmcException
public BmcException(int statusCode, String serviceCode, String message, String opcRequestId, ServiceDetails serviceDetails, String originalMessage, String originalMessageTemplate, Map<String,String> messageArguments, Map<String,String> additionalProperties)
-
BmcException
public BmcException(boolean timeout, String message, Throwable cause, String opcRequestId)
-
BmcException
public BmcException(String message, Throwable cause, int statusCode, String serviceCode, boolean timeout, String opcRequestId, boolean isClientSide, ServiceDetails serviceDetails, String originalMessage, String originalMessageTemplate, Map<String,String> messageArguments, Map<String,String> additionalProperties)
-
-
Method Detail
-
createClientSide
public static BmcException createClientSide(String message, Throwable cause, String opcRequestId, ServiceDetails serviceDetails)
-
getMessage
public String getMessage()
- Overrides:
getMessage
in 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_HEADER
header 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.
-
getMessageArguments
public Map<String,String> getMessageArguments()
Gets the template arguments of the failed Exception.null in the case of non-localized responses.
-
-