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

Make route params available during error handler (Fixes #860) #895

Merged
merged 1 commit into from
Jan 31, 2016

Conversation

jeremyevans
Copy link
Contributor

This is kind of ugly, but I couldn't see a better way. One
potential issue is that the splat and captures route params
will be overwritten by the error handler. There's no way to
change that without breaking backwards compatibility. We
could potentially offer the route splat/captures under
different param names, though.

This is kind of ugly, but I couldn't see a better way.  One
potential issue is that the splat and captures route params
will be overwritten by the error handler.  There's no way to
change that without breaking backwards compatibility.  We
could potentially offer the route splat/captures under
different param names, though.
@rkh
Copy link
Member

rkh commented Jun 28, 2014

I think I am in favour of this patch. Any opinions @kytrinyx, @zzak? Should the same behaviour be adapted for pattern-less before/after blocks?

@kytrinyx
Copy link
Contributor

I'm inclined to agree. It would be really nice to have those handy at that time!

What would be the use-case for having them in the pattern-less before/after blocks?

@rkh
Copy link
Member

rkh commented Jun 29, 2014

What would be the use-case for having them in the pattern-less before/after blocks?

Personally, I've never run into a use case, since then I could usually use a pattern with the filter. People seem to assume it should work, see for instance #417. However, after giving this some thought, I don't think we should do it, since it would only work for after filters.

@kytrinyx
Copy link
Contributor

Agreed, let's not go down that path. I'm happy with this PR as is.

@rkh rkh added this to the 1.5.0 milestone Jun 30, 2014
@zzak zzak added the feature label Feb 6, 2015
zzak pushed a commit that referenced this pull request Jan 31, 2016
Make route params available during error handler (Fixes #860)
@zzak zzak merged commit 391a3c0 into sinatra:master Jan 31, 2016
zzak pushed a commit that referenced this pull request Jan 31, 2016
@zzak zzak modified the milestones: 2.0.0, 1.5.0 Aug 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants