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

Internal: error_log vs trigger_error consistency #8241

Closed
kkmuffme opened this issue Jul 10, 2022 · 3 comments · Fixed by #8243
Closed

Internal: error_log vs trigger_error consistency #8241

kkmuffme opened this issue Jul 10, 2022 · 3 comments · Fixed by #8243

Comments

@kkmuffme
Copy link
Contributor

Does the use of error_log and trigger_error in psalm's code base follow some logic or is it random? Sometimes trigger_error, sometimes error_log (which has Psalm's own error handler attached) is used.

Perhaps this should be made consistent?
trigger_error has the advantage of being universal (and can be universally overwritten by a custom error handler by the user), while error_log has a custom error handler (which ultimately ends up in a custom error handler again if the user has one and also needs time to maintain.) Perhaps remove Psalm's internal error handler and move to trigger_error only?

@psalm-github-bot
Copy link

Hey @kkmuffme, can you reproduce the issue on https://psalm.dev ?

@kkmuffme
Copy link
Contributor Author

Could we teach the psalm-github-bot that if issue has [Internal] or Internal: in the title it will not ask for a reproduction?

@orklah
Copy link
Collaborator

orklah commented Jul 10, 2022

I count only two trigger_error in Psalm's code, both added by contributors and I count 20 error_log and many were added by Matt. AFAIK, error_log does not cause issues at the moment so I'd prefer keeping error_log for now

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 a pull request may close this issue.

2 participants