Symfony2 error 500 instead of 404 at production

前端 未结 11 1227
野性不改
野性不改 2020-12-06 04:49

In my Symfony2 project I\'m getting at development mode correct 404 Exception screen. But I\'m getting blank screen with HTTP status code 500 instead of 404 at production mo

11条回答
  •  广开言路
    2020-12-06 04:54

    I encounteres that Symofny 3 throws an 500 error in production when you do not use

    $this->createNotFoundException()
    

    in your Controller.

    throw Exception('message', 404)
    

    works on dev-enviroment, but not on production.

提交回复
热议问题