Skip to content

Make sure error handling happens on a controller level opposed to action level to account for the controller being extended - #1767

Merged
nbulaj merged 1 commit into
doorkeeper-gem:mainfrom
filipesperandio:expose-error-handling
Apr 4, 2025
Merged

Make sure error handling happens on a controller level opposed to action level to account for the controller being extended#1767
nbulaj merged 1 commit into
doorkeeper-gem:mainfrom
filipesperandio:expose-error-handling

Conversation

@filipesperandio

Copy link
Copy Markdown
Contributor

Summary

When extending the TokensController for any purpose, if any helper method is called and ends up raising an error, that error wasn't being handled by the controller since the rescue was happening at the action level.
Turning an action level rescue into a controller rescue_from will ensure controllers extending TokensController will have the same error handling while enabling it to keep calling the helper methods without worrying about error handling.

…ion level to account for the controller being extended

@nbulaj nbulaj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! Thanks!

Can we add a changelog entry please as well?

@nbulaj

nbulaj commented Apr 4, 2025

Copy link
Copy Markdown
Member

OK I can do it my self actually, wanna to do a release soon. So thanks anyway!

@nbulaj
nbulaj merged commit 6d220b9 into doorkeeper-gem:main Apr 4, 2025
@filipesperandio

Copy link
Copy Markdown
Contributor Author

@nbulaj Thanks!!!

@filipesperandio
filipesperandio deleted the expose-error-handling branch April 8, 2025 14:38
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