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

Update Region.php #348

Closed
wants to merge 1 commit into from
Closed

Update Region.php #348

wants to merge 1 commit into from

Conversation

kingofzihua
Copy link

获取 Region 的时候 如果返回错误 return 的是一个array 里面包含Error 但是上层调用的时候没有做处理,导致报错,并且错误信息并不能描述出问题出在哪里。

//vendor/qiniu/php-sdk/src/Qiniu/Config.php
private function getRegion($accessKey, $bucket)
    {
        $cacheId = "$accessKey:$bucket";

        if (isset($this->regionCache[$cacheId])) {
            $region = $this->regionCache[$cacheId];
        } elseif (isset($this->zone)) {
            $region = $this->zone;
            $this->regionCache[$cacheId] = $region;
        } else {
            /*******这里处理的时候没有考虑到异常的情况,所以$region 是一个数组, 上层调用的时候会报错***/
            $region = Zone::queryZone($accessKey, $bucket);
            $this->regionCache[$cacheId] = $region;
        }
        return $region;
    }

获取 Region 的时候 如果返回错误 return 的是一个array 里面包含Error 但是上层调用的时候没有做处理,导致报错,并且错误信息并不能描述出问题出在哪里。
```
//vendor/qiniu/php-sdk/src/Qiniu/Config.php
private function getRegion($accessKey, $bucket)
    {
        $cacheId = "$accessKey:$bucket";

        if (isset($this->regionCache[$cacheId])) {
            $region = $this->regionCache[$cacheId];
        } elseif (isset($this->zone)) {
            $region = $this->zone;
            $this->regionCache[$cacheId] = $region;
        } else {
            /*******这里处理的时候没有考虑到异常的情况,所以$region 是一个数组, 上层调用的时候会报错***/
            $region = Zone::queryZone($accessKey, $bucket);
            $this->regionCache[$cacheId] = $region;
        }
        return $region;
    }
```
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants