Hello,
Sidekiq integrations calls Raven.capture_exception like this:
Raven.capture_exception(
ex,
:message => ex.message,
:extra => { :sidekiq => context }
)
Unfortunately, if ex.message isn't a String (in our case, it was a Hash), it fails with NoMethodError: undefined method `byteslice' for []:Array
I know it's weird that ex.message isn't a String, but it works when calling it like this :
# ex is an exception
Raven.capture_exception(ex)
When looking at code, event.message is interpolated properly only if Raven.capture_exception wasn't call with options message
# lib/raven/event.rb
def self.from_exception(exc, options = {}, &block)
...
new(options) do |evt|
evt.message = "#{exc.class}: #{exc.message}" # interpolated properly
evt.add_exception_interface(exc)
yield evt if block
end
end
Is it a bug ? I don't know, but I had to to_s my value before raising an exception.
Thanks
Hello,
Sidekiq integrations calls
Raven.capture_exceptionlike this:Unfortunately, if
ex.messageisn't a String (in our case, it was a Hash), it fails withNoMethodError: undefined method `byteslice' for []:ArrayI know it's weird that
ex.messageisn't a String, but it works when calling it like this :When looking at code,
event.messageis interpolated properly only ifRaven.capture_exceptionwasn't call with optionsmessageIs it a bug ? I don't know, but I had to
to_smy value before raising an exception.Thanks