kenichi / angelo

Sinatra-like DSL for Reel that supports WebSockets and SSE
Other
303 stars 23 forks source link

NoMethodError: undefined method `report_errors?' for Angelo::Server #81

Closed Sod-Almighty closed 6 years ago

Sod-Almighty commented 6 years ago

I believe I have found a bug. In angelo/base.rb, line 287, you have:

warn e.message if report_errors?

self at this point is #<Celluloid::Proxy::Cell(Angelo::Server:0x2b23a590ec0c) @base=MyHTTPServer @options={:host=>"0.0.0.0", :port=>2347} @callback=#<Proc:0x000056474bd20df0 (lambda)> @server=#<Celluloid::IO::TCPServer:0x000056474bcffdf8 @socket=#<TCPServer:fd 15, AF_INET, 0.0.0.0, 2347>>>, which is also an instance of Angelo::Server

It does not have a method report_errors?. However, @base does, given that MyHTTPServer is a subclass of Angelo::Base.

I believe the line should be rewritten to:

warn e.message if @base.report_errors?
kenichi commented 6 years ago

@Sod-Almighty thanks, i believe you're correct. anything defined via task runs in the context of the main reactor instance, the Angelo::Server. would you like to submit a PR?

Sod-Almighty commented 6 years ago

Seriously?

This would require forking it, editing it, creating a new commit, issuing a pull request, and then waiting for you to accept it. And that's after I've already gone to the trouble of finding the bug, tracking down the cause, identifying a fix and creating a post telling you exactly what it was.

On the whole, I think I'd rather you just changed a single line of code in your repo, frankly. I mean come on, it's one line of code. Just how lazy are you?

kenichi commented 6 years ago

it's an effort to allow you to contribute; but, since you prefer to be an ass, never mind.