jdesrosiers / silex-cors-provider

A silex service provider that adds CORS services to silex
MIT License
78 stars 25 forks source link

add message to NotFoundHttpException #39

Closed adrianbardan closed 6 years ago

adrianbardan commented 6 years ago

Hi,

I came across this situation that could create a bit of confusion - the 404 (NotFoundHttpException) is triggered without a message. I think the proper message would be that there is no route defined for that path, so if you agree that returning a message is useful in this situation, you could include this in the main build.

Regards Adrian

jdesrosiers commented 6 years ago

Sorry, for the slow response.

Thanks for the contribution! Ideally, what I would like is for this to not have to throw a not found exception at all. I'd rather it just not match on the route and allow Silex's default not found handling to do it's thing. I didn't figure out how to do that when I wrote this originally. I had intended that part to be temporary until I could come up with a way to not need the exception at all, so I didn't put thought into an error message.

So, if you figure out a way to not need the exception at all, please send that PR in as well!