これはおそらく SF リクエストのように聞こえるかもしれませんが、ブロックtry {}
内から Exception がスローされたブロックの先頭に戻る方法はありcatch() {}
ますか?
次に例を示します。
try
{
// make OAuth request
}
catch(OAuthException $e)
{
// if(){}
// If tells me that the Exception was thrown because the access token is expired
// I have alternative access token (that's always up to date, but there is a catch why I void using it)
// I set it as a new access token and want to repeat the try {} block
}
明らかにgoto
それを行うことができますが、より洗練されたアプローチがあるかどうかを探しています.