开发者

Try/Catch & If Statement Weirdness

Running into an issue when using an if/else 开发者_如何学编程statement within a try/block.

try {
    $response = $flickr->callPhotos($content, $limit);
    if($response['stat'] === 'fail'){
        throw new Exception('Please authorize this application.');
    } else {
        --> Code that should not be parsed <--
    }
}
catch (Exception $e){
    echo $e->getMessage();
}

When running this code for some reason the error is thrown correctly, the error is echoed correctly, but then the "Code that should not be parsed" is also being allowed to run generating more errors.

Any thoughts? Thanks in advance.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜