类 MochowServiceException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.baidu.mochow.exception.MochowClientException
com.baidu.mochow.exception.MochowServiceException
- 所有已实现的接口:
Serializable
Extension of MochowClientException that represents an error response returned by a Mochow service.
Receiving an exception of this type indicates that the caller's request was correctly transmitted to the service,
but for some reason, the service was not able to process it, and returned an error response instead.
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明static enumIndicates who is responsible (if known) for a failed request. -
构造器概要
构造器构造器说明MochowServiceException(String errorMessage) Constructs a new MochowServiceException with the specified message.MochowServiceException(String errorMessage, Exception cause) Constructs a new MochowServiceException with the specified message and exception indicating the root cause. -
方法概要
修饰符和类型方法说明intReturns the Mochow error code represented by this exception.Returns the human-readable error message provided by the service.Indicates who is responsible for this exception (caller, service, or unknown).Returns the Mochow request ID that uniquely identifies the service request the caller made.intReturns the HTTP status code that was returned with this service exception.voidsetErrorCode(int errorCode) Sets the Mochow error code represented by this exception.voidsetErrorMessage(String errorMessage) Sets the human-readable error message provided by the service.voidsetErrorType(MochowServiceException.ErrorType errorType) Sets the type of error represented by this exception (sender, receiver, or unknown), indicating if this exception was the caller's fault, or the service's fault.voidsetRequestId(String requestId) Sets the Mochow requestId for this exception.voidsetStatusCode(int statusCode) Sets the HTTP status code that was returned with this service exception.
-
构造器详细资料
-
MochowServiceException
Constructs a new MochowServiceException with the specified message.- 参数:
errorMessage- An error message describing what went wrong.
-
MochowServiceException
Constructs a new MochowServiceException with the specified message and exception indicating the root cause.- 参数:
errorMessage- An error message describing what went wrong.cause- The root exception that caused this exception to be thrown.
-
-
方法详细资料
-
setRequestId
Sets the Mochow requestId for this exception.- 参数:
requestId- The unique identifier for the service request the caller made.
-
getRequestId
Returns the Mochow request ID that uniquely identifies the service request the caller made.- 返回:
- The Mochow request ID that uniquely identifies the service request the caller made.
-
setErrorCode
public void setErrorCode(int errorCode) Sets the Mochow error code represented by this exception.- 参数:
errorCode- The Mochow error code represented by this exception.
-
getErrorCode
public int getErrorCode()Returns the Mochow error code represented by this exception.- 返回:
- The Mochow error code represented by this exception.
-
setErrorType
Sets the type of error represented by this exception (sender, receiver, or unknown), indicating if this exception was the caller's fault, or the service's fault.- 参数:
errorType- The type of error represented by this exception (sender or receiver), indicating if this exception was the caller's fault or the service's fault.
-
getErrorType
Indicates who is responsible for this exception (caller, service, or unknown).- 返回:
- A value indicating who is responsible for this exception (caller, service, or unknown).
-
setErrorMessage
Sets the human-readable error message provided by the service.- 参数:
errorMessage- the human-readable error message provided by the service.
-
getErrorMessage
Returns the human-readable error message provided by the service.- 返回:
- the human-readable error message provided by the service.
-
setStatusCode
public void setStatusCode(int statusCode) Sets the HTTP status code that was returned with this service exception.- 参数:
statusCode- The HTTP status code that was returned with this service exception.
-
getStatusCode
public int getStatusCode()Returns the HTTP status code that was returned with this service exception.- 返回:
- The HTTP status code that was returned with this service exception.
-
getMessage
- 覆盖:
getMessage在类中Throwable
-