Sha256: 0d83da5799787943da4086dc74961784411b3b8e6e858b83de86b380dc03e1e6

Contents?: true

Size: 954 Bytes

Versions: 33

Compression:

Stored size: 954 Bytes

Contents

Errplane.configure(true) do |config|
  config.logger               ||= (defined?(logger) ? logger : ENV['rack.logger'])
  config.framework              = "Sinatra"
  config.framework_version      = ::Sinatra::VERSION

  if defined?(settings)
    config.rails_environment  ||= settings.environment
    config.application_root   ||= settings.root
  end
end

def handle_exception(e)
  request_data = {
    :request_url => request.env["REQUEST_URI"],
    :user_agent => request.env["HTTP_USER_AGENT"],
    :params => request.env["rack.request.query_hash"],
    :action => request.env["REQUEST_PATH"],
    :session => (defined?(session) ? session : request.env["rack.session"]) || {}
  }

  Errplane.transmit_unless_ignorable(e, request_data)
  raise e
end

if defined?(error)
  error { handle_exception(request.env['sinatra.error']) }
elsif defined?(Sinatra::Base)
  class Sinatra::Base
    error { handle_exception(request.env['sinatra.error']) }
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
errplane-0.5.30 lib/errplane/sinatra.rb
errplane-0.5.29 lib/errplane/sinatra.rb
errplane-0.5.28 lib/errplane/sinatra.rb
errplane-0.5.27 lib/errplane/sinatra.rb
errplane-0.5.26 lib/errplane/sinatra.rb
errplane-0.5.25 lib/errplane/sinatra.rb
errplane-0.5.24 lib/errplane/sinatra.rb
errplane-0.5.23 lib/errplane/sinatra.rb
errplane-0.5.22 lib/errplane/sinatra.rb
errplane-0.5.21 lib/errplane/sinatra.rb
errplane-0.5.20 lib/errplane/sinatra.rb
errplane-0.5.19 lib/errplane/sinatra.rb
errplane-0.5.18 lib/errplane/sinatra.rb
errplane-0.5.17 lib/errplane/sinatra.rb
errplane-0.5.15 lib/errplane/sinatra.rb
errplane-0.5.14 lib/errplane/sinatra.rb
errplane-0.5.13 lib/errplane/sinatra.rb
errplane-0.5.12 lib/errplane/sinatra.rb
errplane-0.5.11 lib/errplane/sinatra.rb
errplane-0.5.10 lib/errplane/sinatra.rb