ServiceException Class |
表示阿里云服务返回的错误消息。
ServiceException用于处理阿里云服务返回的错误消息。 比如,用于身份验证的AccessKeyID不存在,则会抛出ServiceException。 异常中包含了错误代码,用于让调用者进行特定的处理。
WebException表示的则是在向阿里云服务发送请求时出现的错误。 例如,在发送请求时网络连接不可用,则会抛出WebException的异常。
InvalidOperationException表示客户端代码无法处理或解析返回结果。这种情况 有可能是服务器返回的结果不完整,或不再符合SDK设计时的规范。如果持续遇到该错误,请考虑升级 SDK版本,或联系我们。
通常来讲,调用者只需要处理ServiceException。因为该异常表明请求被服务处理, 但处理的结果表明存在错误。异常中包含了细节的信息,特别是错误代码,可以帮助调用者进行处理。Namespace: Aliyun.OSS.Common
The ServiceException type exposes the following members.
Name | Description | |
---|---|---|
![]() | ServiceException |
初始化新的ServiceException实例。
|
![]() | ServiceException(String) |
初始化新的ServiceException实例。
|
![]() | ServiceException(SerializationInfo, StreamingContext) |
初始化新的ServiceException实例。
|
![]() | ServiceException(String, Exception) |
初始化新的ServiceException实例。
|
Name | Description | |
---|---|---|
![]() | Equals | (Inherited from Object.) |
![]() | Finalize |
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.) |
![]() | GetBaseException |
When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
(Inherited from Exception.) |
![]() | GetHashCode |
Serves as a hash function for a particular type.
(Inherited from Object.) |
![]() | GetObjectData | (Overrides ExceptionGetObjectData(SerializationInfo, StreamingContext).) |
![]() | GetType |
Gets the runtime type of the current instance.
(Inherited from Exception.) |
![]() | MemberwiseClone |
Creates a shallow copy of the current Object.
(Inherited from Object.) |
![]() | ToString |
Creates and returns a string representation of the current exception.
(Inherited from Exception.) |
Name | Description | |
---|---|---|
![]() | Data |
Gets a collection of key/value pairs that provide additional user-defined information about the exception.
(Inherited from Exception.) |
![]() | ErrorCode |
获取错误代码。
|
![]() | HelpLink |
Gets or sets a link to the help file associated with this exception.
(Inherited from Exception.) |
![]() | HostId |
获取Host ID。
|
![]() | HResult |
Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.
(Inherited from Exception.) |
![]() | InnerException |
Gets the Exception instance that caused the current exception.
(Inherited from Exception.) |
![]() | Message |
Gets a message that describes the current exception.
(Inherited from Exception.) |
![]() | RequestId |
获取Request ID。
|
![]() | Source |
Gets or sets the name of the application or the object that causes the error.
(Inherited from Exception.) |
![]() | StackTrace |
Gets a string representation of the frames on the call stack at the time the current exception was thrown.
(Inherited from Exception.) |
![]() | TargetSite |
Gets the method that throws the current exception.
(Inherited from Exception.) |