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