-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add Exception configuration documentation #186
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
Add Exception configuration documentation #186
Conversation
Ready for review, ping @GregoireHebert |
|
||
The framework also allows to configure the HTTP status code sent to the clients when custom exceptions are thrown. | ||
|
||
In the following example, we will throw explain to throw a domain exception from the business layer of the application and |
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.
[...] we will throw explain to throw a domain exception [...]
The framework also allows to configure the HTTP status code sent to the clients when custom exceptions are thrown. | ||
|
||
In the following example, we will throw explain to throw a domain exception from the business layer of the application and | ||
configure API Platform to convert it to a `404 Not Found` error. Let's create a this domain exception and the service throwing |
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.
[...] Let's create a this domain exception [...]
} | ||
|
||
if (!$product->isPubliclyAvailable()) { | ||
// Using internal codes for a better understanding of what's going on |
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.
Finally there isn't internal code used here... Maybe remove the comment ?
This needs a rebase, @GregoireHebert could you please do it ? |
Oh sorry no, I can't, this is dunglas branch based on mine... I did it in another PR. |
Follows #173.