Skip to content

[HttpKernel] 15874 framework exceptions #15916

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

Merged
merged 1 commit into from
Dec 7, 2021
Merged

Conversation

JohJohan
Copy link
Contributor

Fixes #15874

Copy link
Member

@lyrixx lyrixx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I let few comments

@JohJohan
Copy link
Contributor Author

Thanks. I let few comments

Thanks for the review, should i make it one commit again? Or is it okay like this?

@kbond
Copy link
Member

kbond commented Oct 26, 2021

I was wondering if it uses an instance of the exception class. I checked the code and it does, maybe this should be documented? Also, the order is important.

@JohJohan
Copy link
Contributor Author

JohJohan commented Oct 26, 2021

I was wondering if it uses an instance of the exception class. I checked the code and it does, maybe this should be documented? Also, the order is important.

@kbond So it would be nice to have 2 notices 1 mentioning the exception should extend from \Exception? And one note about that the ordering is imported?

@kbond
Copy link
Member

kbond commented Oct 26, 2021

mentioning the exception should extend from \Exception

This isn't what I meant. I meant that the first exception class that passes an instanceof is what is used.

I think one notice is sufficient as it is related:

framework:
    exceptions:
        Exception:
            log_level: debug
            status_code: 404
        RuntimeException: # this will never be used as \RuntimeException extends \Exception
            log_level: debug
            status_code: 422

The fix would be to reverse the above:

framework:
    exceptions:
        RuntimeException:
            log_level: debug
            status_code: 422
        Exception:
            log_level: debug
            status_code: 404

Hope that makes sense.

@javiereguiluz
Copy link
Member

Thanks Johan! This is now merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[HttpKernel] Add support for configuring log level, and status code by …
5 participants