Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine OssException #5

Merged
merged 1 commit into from
Dec 12, 2015
Merged

Refine OssException #5

merged 1 commit into from
Dec 12, 2015

Conversation

rockuw
Copy link
Contributor

@rockuw rockuw commented Dec 12, 2015

Make detailed error information accessable. Use it like this:

try {
    $ossClient->getBucketAcl('hello');
} catch (OssException $e) {
    print($e->getMessage() . "\n");
    print("Details: " . $e->getDetails() . "\n");
    print("HTTP Code: " . $e->getHTTPStatus() . "\n");
    print("RequestId: " . $e->getRequestId() . "\n");
    print("ErrorCode: " . $e->getErrorCode() . "\n");
    print("ErrorMessage: " . $e->getErrorMessage() . "\n");
}

@rockuw
Copy link
Contributor Author

rockuw commented Dec 12, 2015

@EdwardAA Please check if this fixes your problem.

Thanks.

@rockuw
Copy link
Contributor Author

rockuw commented Dec 12, 2015

Output like this:

NoSuchBucket: The specified bucket does not exist. RequestId: 566B95FC207FB3044303D8A6
Details: <?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>NoSuchBucket</Code>
<Message>The specified bucket does not exist.</Message>
<RequestId>566B95FC207FB3044303D8A6</RequestId>
<HostId>hello.oss-test.aliyun-inc.com</HostId>
<BucketName>hello</BucketName>
</Error>

HTTP Code: 404
RequestId: 566B95FC207FB3044303D8A6
ErrorCode: NoSuchBucket
ErrorMessage: The specified bucket does not exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants