tp5實現自定義異常類:
1.在applocation 下新建 Exception 文件夾,用來放自定義的異常類,
2.在Exception 建立Exception .php類,引入think\exception\handle;
think\exception\handle 是系統的異常處理類,handle是處理異常的,render是顯示異常處理的界面,
所以要重寫此方法。
json中的$data不存在,頁面一定會報錯
報錯結果如下:
tp5實現自定義異常類:
1.在applocation 下新建 Exception 文件夾,用來放自定義的異常類,
2.在Exception 建立Exception .php類,引入think\exception\handle;
think\exception\handle 是系統的異常處理類,handle是處理異常的,render是顯示異常處理的界面,
所以要重寫此方法。
報錯結果如下:
$fileContent = trim($fileContent); $fileContent=$queueList->characet($fileContent);