ServiceException Class |
表示阿里云服务返回的错误消息。
ServiceException用于处理阿里云服务返回的错误消息。 比如,用于身份验证的AccessKeyID不存在,则会抛出ServiceException。 异常中包含了错误代码,用于让调用者进行特定的处理。
WebException表示的则是在向阿里云服务发送请求时出现的错误。 例如,在发送请求时网络连接不可用,则会抛出WebException的异常。
InvalidOperationException表示客户端代码无法处理或解析返回结果。这种情况 有可能是服务器返回的结果不完整,或不再符合SDK设计时的规范。如果持续遇到该错误,请考虑升级 SDK版本,或联系我们。
通常来讲,调用者只需要处理ServiceException。因为该异常表明请求被服务处理, 但处理的结果表明存在错误。异常中包含了细节的信息,特别是错误代码,可以帮助调用者进行处理。Namespace: Aliyun.OSS.Common
[SerializableAttribute] public class ServiceException : Exception
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 | (Inherited from Object.) |
![]() | GetBaseException | 当在派生类中重写时,返回 Exception,它是一个或多个并发的异常的根源。 (Inherited from Exception.) |
![]() | GetHashCode |
用作特定类型的哈希函数。
(Inherited from Object.) |
![]() | GetObjectData | (Overrides ExceptionGetObjectData(SerializationInfo, StreamingContext).) |
![]() | GetType | 获取当前实例的运行时类型。 (Inherited from Exception.) |
![]() | MemberwiseClone |
创建当前 Object 的浅表副本。
(Inherited from Object.) |
![]() | ToString | 创建并返回当前异常的字符串表示形式。 (Inherited from Exception.) |
Name | Description | |
---|---|---|
![]() | Data | 获取一个提供用户定义的其他异常信息的键/值对的集合。 (Inherited from Exception.) |
![]() | ErrorCode |
获取错误代码。
|
![]() | HelpLink | 获取或设置指向此异常所关联帮助文件的链接。 (Inherited from Exception.) |
![]() | HostId |
获取Host ID。
|
![]() | HResult | 获取或设置 HRESULT,它是分配给特定异常的编码数值。 (Inherited from Exception.) |
![]() | InnerException | 获取导致当前异常的 Exception 实例。 (Inherited from Exception.) |
![]() | Message | 获取描述当前异常的消息。 (Inherited from Exception.) |
![]() | RequestId |
获取Request ID。
|
![]() | Source | 获取或设置导致错误的应用程序或对象的名称。 (Inherited from Exception.) |
![]() | StackTrace | 获取当前异常发生时调用堆栈上的帧的字符串表示形式。 (Inherited from Exception.) |
![]() | TargetSite | 获取引发当前异常的方法。 (Inherited from Exception.) |