0
我嘗試添加exeption時沒有發現IA頁,404Symfony的FOSRestBundle異常錯誤404
所以我加這是ocnfig fos_rest:
# 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.
'Acme \ HelloBundle \ Exception \ MyExceptionWithASafeMessage''是否延伸'\ Exception'? – Mawcel
像這樣'Acme \ HelloBundle \ Exception \ MyExceptionWithASafeMessage'extend \ Exeption:true? 有了這個我有錯誤:不包含有效的YAML – Ygg69
顯示'Acme \ HelloBundle \ Exception \ MyExceptionWithASafeMessage'類的代碼 – Mawcel