Sha256: 5c528036d494667a17e65b56032f1f3f382b3b54c04b86d09292abecdc2ffe53

Contents?: true

Size: 431 Bytes

Versions: 3

Compression:

Stored size: 431 Bytes

Contents

require 'sinatra/base'
require 'sinatra/errorcodes/version'

require_relative '../4xx_errors.rb'
require_relative '../5xx_errors.rb'
require_relative '../error_base.rb'

module Sinatra
  include HTTPError

  module Errorcodes
    def self.registered(app)
      app.set :halt_with_errors, false

      app.error ErrorBase do |e|
        return unless settings.halt_with_errors
        halt e.code, e.msg
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sinatra-errorcodes-0.4.2 lib/sinatra/errorcodes.rb
sinatra-errorcodes-0.4.1 lib/sinatra/errorcodes.rb
sinatra-errorcodes-0.3.1 lib/sinatra/errorcodes.rb