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

Request object received in ErrorHandler is not in context #3252

Closed
odahcam opened this issue Feb 23, 2023 · 2 comments
Closed

Request object received in ErrorHandler is not in context #3252

odahcam opened this issue Feb 23, 2023 · 2 comments

Comments

@odahcam
Copy link

odahcam commented Feb 23, 2023

I'm just mentioning #3250 since it was closed before the correct understanding of the problem so it can be reviewed again and maybe reopened.

@odan
Copy link

odan commented Feb 23, 2023

Hi @odahcam

Handling errors and exceptions in a way that provides useful context can be challenging, especially when dealing with third-party libraries or PHP errors that are not caught within your own code.

The Slim 4 ErrorMiddleware is able to catch TypeError because it's extended from Throwable. So when you add the ErrorMiddleware as last middleware, it will also catch this kind of exceptions from any third-party libraries.

Besides Throwable PHP has its older error level system of "errors".
To "catch" these types of PHP errors, you may add a custom middleware.

But to get a deeper understanding, we need more context and an example of what's the actual problem is. I would suggest you post a minimal example to demonstrate your specific use case. Then explain what is the current behavior and what is the "expected" behavior. I hope that we can find a solution.

@akrabat
Copy link
Member

akrabat commented May 1, 2024

Closing as no further info provided by OP.

@akrabat akrabat closed this as not planned Won't fix, can't repro, duplicate, stale May 1, 2024
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

No branches or pull requests

3 participants