super(warning) set_backtrace(caller) end end Warning.process('', keyword_separation: -> (warning) do caller = caller(2).drop_while { |path| path.match?(%r!/gems/warning-!) } message = warning.sub(/^.+: warning: /, '') err = WarningAsError.new(message, caller) Raven.capture_exception(err, level: 'warning') :default end)