OSS/Exceptions/OSSException.php

Show: PublicProtectedPrivateinherited
Table of Contents
Copyright (C) Alibaba Cloud Computing All rights reserved.

版权所有 (C)阿里云计算有限公司

\Aliyun\OSS\Exceptions\OSSException

Package: Aliyun\OSS\Exceptions
该异常在对开放存储数据服务(Open Storage Service)访问失败时抛出。

ServiceException用于处理阿里云服务返回的错误消息。比如,用于身份验证的Access ID不存在, 则会抛出ServiceException(严格上讲,会是该类的一个继承类。比如,OTSClient会抛出OTSException)。 异常中包含了错误代码,用于让调用者进行特定的处理。

ClientException表示的则是在向阿里云服务发送请求时出现的错误,以及客户端无法处理返回结果。 例如,在发送请求时网络连接不可用,则会抛出ClientException的异常。

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

Parent(s)
\Aliyun\Common\Exceptions\ServiceException < \RuntimeException

Properties

Methods

methodpublic__construct( $code,  $message,  $requestId,  $hostId) : void

Parameters
NameTypeDescription
$code
$message
$requestId
$hostId
methodpublicgetErrorCode() : \Aliyun\Common\Exceptions\错误代码
inherited

返回错误代码

Inherited from: \Aliyun\Common\Exceptions\ServiceException::getErrorCode()
Returns
TypeDescription
\Aliyun\Common\Exceptions\错误代码
methodpublicgetHostId() : \Aliyun\Common\Exceptions\Host标识。
inherited

返回Host标识。

Inherited from: \Aliyun\Common\Exceptions\ServiceException::getHostId()
Returns
TypeDescription
\Aliyun\Common\Exceptions\Host标识。
methodpublicgetRequestId() : \Aliyun\Common\Exceptions\Request标识。
inherited

返回Request标识。

Inherited from: \Aliyun\Common\Exceptions\ServiceException::getRequestId()
Returns
TypeDescription
\Aliyun\Common\Exceptions\Request标识。
Documentation was generated by phpDocumentor 2.0.0a12.