Top Fields Constructors Methods
com.oracle.bmc.model

public Class BmcException

extends SdkRuntimeException
Class Inheritance
Known Direct Subclasses
com.oracle.bmc.auth.exception.AuthClientException, com.oracle.bmc.auth.exception.AuthServerException
Imports
com.oracle.bmc.ClientRuntime, .ServiceDetails, com.oracle.bmc.http.internal.HttpDateUtils, com.oracle.bmc.util.internal.StringUtils, java.util.Date, .Map

Field Summary

Modifier and TypeField and Description
private final Map<String, String>
additionalProperties

Map for optional/unknown attributes outside of DEX error codes https://confluence.oraclecorp.com/confluence/display/DEX/Error+Codes

private final boolean
isClientSide

Flag to indicate that the exception originated from the client and not from the service.

private final Map<String, String>
messageArguments

The values to be substituted into the originalMessageTemplate, expressed as a string-to-string map.

public static final String
OPC_REQUEST_ID_HEADER

Name of the header that contains the request id.

private final String
opcRequestId

The opc-request-id header returned by the service that should be provided for support requests.

private final String
originalMessage

A human-readable error string in English.

private final String
originalMessageTemplate

Template in ICU MessageFormat for the human-readable error string in English, but without the values replaced.

private final String
serviceCode

Service specific code returned.

private final ServiceDetails
serviceDetails

Details about the service of the Exception

private final int
statusCode

The HTTP status code.

private final boolean
timeout

Flag to indicate that the request timed out.

Constructor Summary

AccessConstructor and Description
public
BmcException(int statusCode, String serviceCode, String message, String opcRequestId, Throwable cause)

public
BmcException(int statusCode, String serviceCode, String message, String opcRequestId, Throwable cause, ServiceDetails serviceDetails)

public
BmcException(int statusCode, String serviceCode, String message, String opcRequestId)

public
BmcException(int statusCode, String serviceCode, String message, String opcRequestId, ServiceDetails serviceDetails)

public
BmcException(int statusCode, String serviceCode, String message, String opcRequestId, ServiceDetails serviceDetails, String originalMessage, String originalMessageTemplate, Map<String, String> messageArguments)

public
BmcException(int statusCode, String serviceCode, String message, String opcRequestId, ServiceDetails serviceDetails, String originalMessage, String originalMessageTemplate, Map<String, String> messageArguments, Map<String, String> additionalProperties)

public
BmcException(boolean timeout, String message, Throwable cause, String opcRequestId)

private
BmcException(String message, Throwable cause, int statusCode, String serviceCode, boolean timeout, String opcRequestId, boolean isClientSide, ServiceDetails serviceDetails)

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)

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)

Method Summary

Modifier and TypeMethod and Description
public static BmcException
createClientSide(String message, Throwable cause, String opcRequestId, ServiceDetails serviceDetails)

public Map<String, String>
getAdditionalProperties()

Gets the unknown attributes of the failed Exception.

public String
getMessage()

Overrides java.lang.Throwable.getMessage.

Returns the detail message string of this throwable.

public Map<String, String>
getMessageArguments()

Gets the template arguments of the failed Exception.

public String
getOpcRequestId()

The opc-request-id header returned by the service that should be provided for support requests.

public String
getOriginalMessage()

Gets the original message of the failed Exception.

public String
getOriginalMessageTemplate()

Gets the original message template of the failed Exception.

public String
getServiceCode()

Service specific code returned.

public ServiceDetails
getServiceDetails()

Gets the service details of the failed Exception.

public int
getStatusCode()

The HTTP status code.

public String

Returns:

unmodified exception message
getUnmodifiedMessage
()

Returns the exception message, without adding additional troubleshooting information to it.

public boolean
isClientSide()

Flag to indicate that the exception originated from the client and not from the service.

public boolean
isTimeout()

Flag to indicate that the request timed out.

Field Detail

additionalPropertiesback to summary
private final Map<String, String> additionalProperties

Map for optional/unknown attributes outside of DEX error codes https://confluence.oraclecorp.com/confluence/display/DEX/Error+Codes

isClientSideback to summary
private final 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.

messageArgumentsback to summary
private final Map<String, String> messageArguments

The values to be substituted into the originalMessageTemplate, expressed as a string-to-string map. Optional field in localized error responses.

OPC_REQUEST_ID_HEADERback to summary
public static final String OPC_REQUEST_ID_HEADER

Name of the header that contains the request id.

opcRequestIdback to summary
private final String opcRequestId

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 BmcException#OPC_REQUEST_ID_HEADER header set by the caller in an invocation callback, or otherwise a value automatically generated by the SDK.

originalMessageback to summary
private final String originalMessage

A human-readable error string in English. Optional field in localized error responses.

originalMessageTemplateback to summary
private final String originalMessageTemplate

Template in ICU MessageFormat for the human-readable error string in English, but without the values replaced. Optional field in localized error responses.

serviceCodeback to summary
private final String serviceCode

Service specific code returned. Null if the client timed out or failed to get a response from the service.

serviceDetailsback to summary
private final ServiceDetails serviceDetails

Details about the service of the Exception

statusCodeback to summary
private final int statusCode

The HTTP status code.

timeoutback to summary
private final boolean timeout

Flag to indicate that the request timed out. Status code and service code should not be used if this is true.

Constructor Detail

BmcExceptionback to summary
public BmcException(int statusCode, String serviceCode, String message, String opcRequestId, Throwable cause)
BmcExceptionback to summary
public BmcException(int statusCode, String serviceCode, String message, String opcRequestId, Throwable cause, ServiceDetails serviceDetails)
BmcExceptionback to summary
public BmcException(int statusCode, String serviceCode, String message, String opcRequestId)
BmcExceptionback to summary
public BmcException(int statusCode, String serviceCode, String message, String opcRequestId, ServiceDetails serviceDetails)
BmcExceptionback to summary
public BmcException(int statusCode, String serviceCode, String message, String opcRequestId, ServiceDetails serviceDetails, String originalMessage, String originalMessageTemplate, Map<String, String> messageArguments)
BmcExceptionback to summary
public BmcException(int statusCode, String serviceCode, String message, String opcRequestId, ServiceDetails serviceDetails, String originalMessage, String originalMessageTemplate, Map<String, String> messageArguments, Map<String, String> additionalProperties)
BmcExceptionback to summary
public BmcException(boolean timeout, String message, Throwable cause, String opcRequestId)
BmcExceptionback to summary
private BmcException(String message, Throwable cause, int statusCode, String serviceCode, boolean timeout, String opcRequestId, boolean isClientSide, ServiceDetails serviceDetails)
BmcExceptionback to summary
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)
BmcExceptionback to summary
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)

Method Detail

createClientSideback to summary
public static BmcException createClientSide(String message, Throwable cause, String opcRequestId, ServiceDetails serviceDetails)
getAdditionalPropertiesback to summary
public Map<String, String> getAdditionalProperties()

Gets the unknown attributes of the failed Exception.

getMessageback to summary
public String getMessage()

Overrides java.lang.Throwable.getMessage.

Doc from java.lang.Throwable.getMessage.

Returns the detail message string of this throwable.

Returns:String

the detail message string of this Throwable instance (which may be null).

Annotations
@Override
getMessageArgumentsback to summary
public Map<String, String> getMessageArguments()

Gets the template arguments of the failed Exception. null in the case of non-localized responses.

getOpcRequestIdback to summary
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 BmcException#OPC_REQUEST_ID_HEADER header set by the caller in an invocation callback, or otherwise a value automatically generated by the SDK.

getOriginalMessageback to summary
public String getOriginalMessage()

Gets the original message of the failed Exception. null in the case of non-localized responses.

getOriginalMessageTemplateback to summary
public String getOriginalMessageTemplate()

Gets the original message template of the failed Exception. null in the case of non-localized responses.

getServiceCodeback to summary
public String getServiceCode()

Service specific code returned. Null if the client timed out or failed to get a response from the service.

getServiceDetailsback to summary
public ServiceDetails getServiceDetails()

Gets the service details of the failed Exception. null in the case of client-side exceptions

getStatusCodeback to summary
public int getStatusCode()

The HTTP status code.

getUnmodifiedMessageback to summary
public String getUnmodifiedMessage()

Returns the exception message, without adding additional troubleshooting information to it.

Returns:String

unmodified exception message

isClientSideback to summary
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.

isTimeoutback to summary
public boolean isTimeout()

Flag to indicate that the request timed out. Status code and service code should not be used if this is true.