【发布时间】:2015-04-11 05:54:03
【问题描述】:
我只是移动到 laravel 5 并且我在 HTML 页面中收到来自 laravel 的错误。像这样的:
Sorry, the page you are looking for could not be found.
1/1
NotFoundHttpException in Application.php line 756:
Persona no existe
in Application.php line 756
at Application->abort('404', 'Person doesnt exists', array()) in helpers.php line
当我使用 laravel 4 时一切正常,错误是 json 格式,这样我就可以解析错误消息并向用户显示消息。 json错误示例:
{"error":{
"type":"Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException",
"message":"Person doesnt exist",
"file":"C:\\xampp\\htdocs\\backend1\\bootstrap\\compiled.php",
"line":768}}
我如何在 laravel 5 中实现这一点。
对不起,我的英语不好,非常感谢。
【问题讨论】:
标签: php laravel http-error