def call(env)
      begin
        @status, @headers, @response = @app.call(env)
      rescue => exception
        raise if configuration.raise_errors?

        error = Error.new(exception)

        unless error.ignore?
          $stderr.print error.formatted
          configuration.monitors.each { |monitor| monitor.report(exception) }
        end

        @status   = error.status
        @response = Response.build(error)
        @headers  = { "Content-Type" => "application/json" }
      end
      [@status, @headers, @response]
    end
def call(env)
      begin
        @status, @headers, @response = @app.call(env)
      rescue => exception
        raise if configuration.raise_errors?

        error = Error.new(exception)

        unless error.ignore?
          $stderr.print error.formatted
          configuration.monitors.each { |monitor| monitor.report(exception) }
        end

        @status   = error.status
        @response = Response.build(error)
        @headers  = { "Content-Type" => "application/json" }
      end
      [@status, @headers, @response]
    end
Public: Initializes the middleware.

 app   - The Rack application.
 block - Optional block for configuring the middleware.

 Returns an instance of the middleware.
 Public: call method for Rack application. Rescues from an exception and
 does the following: 1) Logs the error 2) Reports error to configured
 monitoring services 3) Generates a JSON response with error information.

 env - The environment of the request.

 Returns an array of response data for Rack.