Skip to content

Erroneous statement in ActionDispatch::ParamsParser #3728

whitequark opened this Issue Nov 23, 2011 · 6 comments

3 participants


The code at this line is never reached. Is this a bug? Should the hash be returned sometimes?

kennyj commented Nov 23, 2011

I've been chasing history.

I think that the below commit is the origin.


I think that it is a mistake :-)

/cc @jeremy
do you remember it ?

kennyj commented Nov 23, 2011


I think that this is a bug. And we have two fix way.

1: Return hash. It seems that original source's behavior return hash.


2: Raise an error. Now behavior raise an error.

I think that now behavior is proper (therefore we should remove only the hash).
What do you think ?


@kennyj, I believe that the current behavior is correct, too: the hash itself does not makes much sense for me, and the parsing error should clearly not just be forwarded to action body, as the latter does not expects it and this behavior is not documented anywhere I know.

kennyj commented Nov 23, 2011


The next commit is my opinion.

1: remove unreachable code.
2: re-raise original exception.


Just FYI: raise without arguments is just the same as raise e (in this context) or raise $! (generally). It's fine this way, through.

kennyj commented Nov 23, 2011

@whitequark, I didn't know it. Thanks!

I'll change commit message, and send pull request.

When chasing history, I feel like a historian.

@josevalim josevalim closed this in f62f545 Nov 23, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.