Sha256: 1470e6bf6d716ffd19d0b81628c4a1c9a31972d3da952fe15004a3678a35bb6d
Contents?: true
Size: 728 Bytes
Versions: 13
Compression:
Stored size: 728 Bytes
Contents
require "logtail/config" require "logtail/events/error" require "logtail-rack/middleware" module Logtail module Integrations module Rack # A Rack middleware that is reponsible for capturing exception and error events class ErrorEvent < Middleware def call(env) begin status, headers, body = @app.call(env) rescue Exception => exception Config.instance.logger.fatal do Events::Error.new( name: exception.class.name, error_message: exception.message, backtrace: exception.backtrace ) end raise exception end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems