-
-
Notifications
You must be signed in to change notification settings - Fork 960
Provide a better exception message #1405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,7 +58,7 @@ public function onKernelRequest(GetResponseEvent $event) | |
| if (null === $routeFormat = $request->attributes->get('_format') ?: null) { | ||
| $mimeTypes = array_keys($this->mimeTypes); | ||
| } elseif (!isset($this->formats[$routeFormat])) { | ||
| throw new NotFoundHttpException('Not Found'); | ||
| throw new NotFoundHttpException(sprintf('Format "%s" is not supported', $routeFormat)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd say "415 Unsupported Media Type" or "406 Not Acceptable" but definitely not 404 👍
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://httpstatuses.com/415 is about the payload of the request, so let's go with https://httpstatuses.com/406, which looks like a perfect fit for this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sroze in fact, 404 was right, and extensions shouldn't be used (in production, in development it's ok although I'm starting to think this causes more issues than it solves). |
||
| } else { | ||
| $mimeTypes = Request::getMimeTypes($routeFormat); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 406 right? (same below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope after all