Skip to content

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