visoft / ruby_odata

OData Consumer for Ruby
http://bit.ly/IntroRubyOData
MIT License
107 stars 52 forks source link

Exception in OData::Service.handle_exception(e) #47

Closed maarek closed 10 years ago

maarek commented 10 years ago

I came across an exception in the exception handler

ruby_odata-0.1.5/lib/ruby_odata/service.rb:371:in `handle_exception': undefined method `content' for nil:NilClass (NoMethodError)
from /Users/jlyman/.rvm/gems/ruby-2.0.0-p247/gems/ruby_odata-0.1.5/lib/ruby_odata/service.rb:102:in `rescue in execute'
from /Users/jlyman/.rvm/gems/ruby-2.0.0-p247/gems/ruby_odata-0.1.5/lib/ruby_odata/service.rb:99:in `execute'
from test.rb:8:in `<main>'

This was being caused by my execute query returning HTML stating unauthorized access instead of expected xml.

This should be handled better to display the exception response if parsing or pathing fails.

rgould commented 10 years ago

:+1: experiencing this also