Click or drag to resize
ServiceException Class

表示阿里云服务返回的错误消息。

ServiceException用于处理阿里云服务返回的错误消息。 比如,用于身份验证的AccessKeyID不存在,则会抛出ServiceException。 异常中包含了错误代码,用于让调用者进行特定的处理。

WebException表示的则是在向阿里云服务发送请求时出现的错误。 例如,在发送请求时网络连接不可用,则会抛出WebException的异常。

InvalidOperationException表示客户端代码无法处理或解析返回结果。这种情况 有可能是服务器返回的结果不完整,或不再符合SDK设计时的规范。如果持续遇到该错误,请考虑升级 SDK版本,或联系我们。

通常来讲,调用者只需要处理ServiceException。因为该异常表明请求被服务处理, 但处理的结果表明存在错误。异常中包含了细节的信息,特别是错误代码,可以帮助调用者进行处理。

Inheritance Hierarchy

Namespace: Aliyun.OpenServices.OpenStorageService
Assembly: Aliyun.OSS (in Aliyun.OSS.dll) Version: 1.0.5492.31618
Syntax
[SerializableAttribute]
public class ServiceException : Exception

The ServiceException type exposes the following members.

Constructors
  NameDescription
Public methodServiceException
初始化新的ServiceException实例。
Public methodServiceException(String)
初始化新的ServiceException实例。
Protected methodServiceException(SerializationInfo, StreamingContext)
初始化新的ServiceException实例。
Public methodServiceException(String, Exception)
初始化新的ServiceException实例。
Top
Methods
Properties
  NameDescription
Public propertyData (Inherited from Exception.)
Public propertyErrorCode
获取错误代码。
Public propertyHelpLink (Inherited from Exception.)
Public propertyHostId
获取Host ID。
Protected propertyHResult (Inherited from Exception.)
Public propertyInnerException (Inherited from Exception.)
Public propertyMessage (Inherited from Exception.)
Public propertyRequestId
获取Request ID。
Public propertySource (Inherited from Exception.)
Public propertyStackTrace (Inherited from Exception.)
Public propertyTargetSite (Inherited from Exception.)
Top
Events
  NameDescription
Protected eventSerializeObjectState (Inherited from Exception.)
Top
See Also