Error handling with try and catch in Laravel
我想在我的应用程序中实现良好的错误处理,我已强制此文件捕获错误。
App \\\\\\\\\\ Services \\\\\\\\ PayUService
1 2 3 4 5 | try { $this->buildXMLHeader; // Should be $this->buildXMLHeader(); } catch (Exception $e) { return $e; } |
App \\\\\\\\ Controller \\\\\\\\ ProductController
1 2 3 4 5 |
这就是我得到的。
我不知道为什么Laravel没有将我重定向到视图。
错误是否被强制执行?
您位于
1 2 3 4 5 6 7 8 | try { $this->buildXMLHeader(); } catch (\\Exception $e) { return $e->getMessage(); } |
在您的代码中,您已经使用过
1 | App\\Services\\PayUService\\Exception |
由于