Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はErrorException以下の関数呼び出しを取得します。どうすればいいの?捕まらないのはなぜ?
ErrorException
try { static::$function_name($url); } catch (Exception $e) {}
エラーの根本的な理由はfile_put_contents呼び出しです。違いがある場合は、Laravel 4 フレームワークを使用しています。
file_put_contents
これを書く必要があると思います:
try { static::$function_name($url); } catch (\Exception $e) {}
Exception の前の \ に注意してください。
名前空間を宣言したら、Exception などのクラスの前にルート名前空間を指定する必要があります。そうしないと、ここの catch ブロック\Your\Namespace\Exceptionは だけでなくを探します。\Exception
\Your\Namespace\Exception
\Exception