statianzo / que-web

A web interface for the Que queue
BSD 3-Clause "New" or "Revised" License
88 stars 50 forks source link

Handle empty last_error strings #40

Closed joehorsnell closed 6 years ago

joehorsnell commented 6 years ago

If the last_error of a failed Que job is an empty string (which can happen on older versions of Que that do not include the stack trace in the last error) the Failed jobs page blows up with an exception, as format_error assumes that a non-nil value will not be a blank string:

NoMethodError - undefined method `length' for nil:NilClass:
        que-web/lib/que/web.rb:196:in `truncate'
        que-web/lib/que/web.rb:188:in `format_error'
        que-web/web/views/failing.erb:35:in `block (2 levels) in singleton class'
        que-web/web/views/failing.erb:25:in `each'
        .
        .
statianzo commented 6 years ago

Wonderful contribution, @joehorsnell! Thank you for adding changelog updates and specs.

joehorsnell commented 6 years ago

You are welcome @statianzo - thanks for reviewing so quickly.

If you were able to push a new version to RubyGems at some point, that would be much appreciated 😄

statianzo commented 6 years ago

Released as 0.7.1

joehorsnell commented 6 years ago

Released as 0.7.1

Legend - cheers.