laravel異常相關

1.在Console/Commands 腳本文件中,handle()方法里給命令行在執行中的提示
$this->line() 簡單的輸出(白色)
$this->info() 綠色輸出,可代表完成
$this->error() 紅色的輸出,可代表拋錯

2.關于try catch使用
try{
throw new Exception('出錯');
throw new OtherException('出錯');
}catch(\Exception $e){
return $e->getMessage();
}catch(\OtherException $e){
return $e->getMessage();
}

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容