Skip to content
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

Throw an http exception so it doesn't get reported #5642

Merged
merged 2 commits into from
Aug 30, 2024
Merged

Conversation

pxpm
Copy link
Contributor

@pxpm pxpm commented Aug 30, 2024

WHY

BEFORE - What was wrong? What was happening before this PR?

Reported in Laravel-Backpack/docs#590
We throw a regular Exception, that developer would need to manually add to "dontReport" if they don't want their logs filled with Access exceptions.

AFTER - What is happening after this PR?

The AccessDeniedException will no longer report to the log system as it will be treated as an HttpException under the hood.

HOW

How did you achieve that, in technical terms?

We throw an a copy of Laravel AuthorizationException that's already non-reported by Laravel. There reason we don't throw the Laravel directly and throw our "custom", is to avoid a BC. We can totally remove our custom exception in next major version.

Is it a breaking change?

Nop.

@pxpm pxpm merged commit d764684 into main Aug 30, 2024
3 checks passed
@pxpm pxpm deleted the throw-an-http-exception branch August 30, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants