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

HttpException extends RuntimeException #3144

Closed
visavi opened this issue Jan 30, 2022 · 3 comments · Fixed by #3146
Closed

HttpException extends RuntimeException #3144

visavi opened this issue Jan 30, 2022 · 3 comments · Fixed by #3146

Comments

@visavi
Copy link

visavi commented Jan 30, 2022

Hello everyone, I have a question, why not make the HttpException class inherit from RuntimeException
https://github.com/slimphp/Slim/blob/4.x/Slim/Exception/HttpException.php#L20

This is how it is done in the symfony and in other frameworks

The fact is that phpstorm RuntimeException is added to the exceptions by default, more details here
https://blog.jetbrains.com/phpstorm/2018/04/configurable-unchecked-exceptions/

@nbayramberdiyev
Copy link
Contributor

Hey @visavi, what benefits does it provide except being useful for PhpStorm users only?

Despite being IDE-specific improvement, I'm happy to submit a PR if you're open to it @l0gicgate, @odan.

@odan
Copy link
Contributor

odan commented Feb 7, 2022

From my side, a 👍 for this change. It is generally a better practice to extend from RuntimeException. The Slim 4 ErrorMiddleware should not be affected.

@l0gicgate
Copy link
Member

I'm open to making this change. Since it extends Exception it shouldn't break anything.

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

Successfully merging a pull request may close this issue.

4 participants