2017-02-27 9 views
0

私はので、私はこれがocnfig fos_restで追加404symfonyのFOSRestBundle例外エラー404

、IAページが見つからないときexeptionを追加しよう:

# exception: 
#  codes: 
#   'Symfony\Component\Routing\Exception\ResourceNotFoundException': 404 
#   'Doctrine\ORM\OptimisticLockException': HTTP_CONFLICT 
#  messages: 
#   'Acme\HelloBundle\Exception\MyExceptionWithASafeMessage': true 

しかし、私はこのエラーがあります:

FOSRestBundle exception mapper: Could not load class 'Acme\HelloBundle\Exception\MyExceptionWithASafeMessage' or the class does not extend from '\Exception'. Most probably this is a configuration problem. 
+0

'' Acme \ HelloBundle \ Exception \ MyExceptionWithASafeMessage''は '\ Exception'を拡張しますか? – Mawcel

+0

このような 'Acme \ HelloBundle \ Exception \ MyExceptionWithASafeMessage' extend \ Exeption:true? これで私はエラーがあります:有効なYAMLを含んでいません – Ygg69

+0

'Acme \ HelloBundle \ Exception \ MyExceptionWithASafeMessage 'クラスのコードを表示 – Mawcel

答えて

0

名前空間がacmeなので、デモチュートリアルのコードをコピーしていてバンドルが存在しないようです。

\ Exceptionを拡張するOWN例外クラスを作成し、その名前空間をymlに渡す必要があります。

関連する問題