Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Add missing parameter to on_failure block. #27

Closed
wants to merge 1 commit into from

Conversation

jabr
Copy link

@jabr jabr commented Jun 13, 2013

No description provided.

@iconara
Copy link
Owner

iconara commented Jun 14, 2013

Have you had problems with that code? The parameter isn't necessary.

This does not raise any errors:

f = Future.new
f.on_failure { p :ok }
f.fail!(StandardError.new)

@jabr
Copy link
Author

jabr commented Jun 14, 2013

Yes, it throws "undefined local variable or method 'e'".

​The existing code passes 'e' to the fail! call in the block, but it was missing the |e| parameter for the block.

On Thu, Jun 13, 2013 at 10:15 PM, Theo Hultberg [email protected]
wrote:

Have you had problems with that code? The parameter isn't necessary.
This does not raise any errors:

f = Future.new
f.on_failure { p :ok }
f.fail!(StandardError.new)

Reply to this email directly or view it on GitHub:
#27 (comment)

@iconara
Copy link
Owner

iconara commented Jun 14, 2013

Oh, right you are. I assumed I had test coverage on that so I didn't even look properly that the block used an non-existing variable/parameter. Sorry, should have looked closer.

I can fix this, but if you'd like this pull request merged I need a test that covers it.

@iconara
Copy link
Owner

iconara commented Jun 14, 2013

I've fixed it, it's in master now. Will release a v1.0.1 soon. Thanks a lot for reporting it, and sorry for missing the real issue at first.

@iconara iconara closed this Jun 14, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants