php5風エラー処理。
返り値に配列が入れば便利だと思うんだけどなー。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | class model{ function hoge(){ //エラー発生 throw new exception('エラー内容') } } try{ $model= new model(); $data=$model->hoge(); } catch( exception $e ){ $error = $e->getMessage(); } |
php5風エラー処理。
返り値に配列が入れば便利だと思うんだけどなー。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | class model{ function hoge(){ //エラー発生 throw new exception('エラー内容') } } try{ $model= new model(); $data=$model->hoge(); } catch( exception $e ){ $error = $e->getMessage(); } |