Skip to content

raise instead of throw ? #2564

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

Open
ericproulx opened this issue May 4, 2025 · 0 comments
Open

raise instead of throw ? #2564

ericproulx opened this issue May 4, 2025 · 0 comments
Assignees

Comments

@ericproulx
Copy link
Contributor

ericproulx commented May 4, 2025

There are few places in the code that we raise an exception instead of throw :error and vice-versa.

We should be consistent in the code base since we mostly treat throw like exception. For instance, when dealing with Grape::Exceptions::ValidationErrors, we rescue them through rescue_from and throw and :error afterward with the backtrace and original_exception.

@ericproulx ericproulx changed the title raise instead of throw raise instead of throw May 4, 2025
@ericproulx ericproulx changed the title raise instead of throw raise instead of throw ? May 4, 2025
@ericproulx ericproulx self-assigned this May 4, 2025
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

1 participant