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

nilbus opened this Issue Dec 24, 2009 · 0 comments


None yet
1 participant

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 = do
fetch ''
record do # Could also be "doesntExist do", for the same results.
year '2010'
item_name 'Okamikakushi'
next_page 'next >>'

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