Sha256: a92d926551dfe19852991cd1815b61c91de0bc74a291802f230fe3de24dd3e1a

Contents?: true

Size: 579 Bytes

Versions: 2

Compression:

Stored size: 579 Bytes

Contents

class Zeppelin
  class ResourceNotFound < Faraday::Error::ResourceNotFound
  end

  class ClientError < Faraday::Error::ClientError
  end

  module Middleware
    # Intercept Faraday errors and re-raise our own to hide implementation details
    #
    # @private
    class ResponseRaiseError < Faraday::Response::RaiseError
      def on_complete(env)
        super
      rescue Faraday::Error::ResourceNotFound => msg
        raise ResourceNotFound, msg.response
      rescue Faraday::Error::ClientError => msg
        raise ClientError, msg.response
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
zeppelin-0.8.4 lib/zeppelin/middleware/response_raise_error.rb
zeppelin-0.8.3 lib/zeppelin/middleware/response_raise_error.rb