Sha256: cf1e207e52cf7d1f50719840679a0addaac23ea7b8bb9a316eadcffdcea2a529

Contents?: true

Size: 322 Bytes

Versions: 2

Compression:

Stored size: 322 Bytes

Contents

module Ditty
  module Middleware
    class ErrorCatchall
      attr_reader :env

      def initialize(app)
        @app = app
      end

      def call(env)
        @env = env
        begin
          @app.call env
        rescue StandardError
          [500, {}, ['Unknown Error']]
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ditty-0.3.3 lib/ditty/middleware/error_catchall.rb
ditty-0.3.2 lib/ditty/middleware/error_catchall.rb