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

skimr: Confusing error message when using an improperly named block #5

Open
nilbus opened this issue Dec 24, 2009 · 0 comments
Open

Comments

@nilbus
Copy link

nilbus commented Dec 24, 2009

Trying to use the new skimr rewrite, and I tried use one of the old scrubyt examples, not knowing that things aren't the same way anymore. Spent a long time debugging, just to find out that the nil object error was insignificant, and that I was passing a block to a nonexistent function. The traceback and error did not show the name of the function I was calling

The following code generated the following traceback:

@extractor = Scrubyt::Extractor.new do
fetch 'http://theninthcut.com/anime'
record do # Could also be "doesntExist do", for the same results.
year '2010'
item_name 'Okamikakushi'
end
next_page 'next >>'
end

NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.sub
from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/results_extraction.rb:292:in clean_xpath' from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/results_extraction.rb:122:inevaluate_xpath'
from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/results_extraction.rb:160:in extract_detail' from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/results_extraction.rb:159:inmap'
from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/results_extraction.rb:159:in extract_detail' from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/extractor.rb:60:inmethod_missing'
from (irb):5:in boom' from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/extractor.rb:41:ininstance_eval'
from /home/nilbus/git/theninthcut/vendor/plugins/scrubyt-skimr/lib/scrubyt/extractor.rb:41:in initialize' from (irb):3:innew'
from (irb):3:in `boom'
from (irb):12

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