Sha256: af54a05fee441cf6de1f316e3200418e4245c7e34d98d40a0e72397b16a90942
Contents?: true
Size: 559 Bytes
Versions: 11
Compression:
Stored size: 559 Bytes
Contents
# frozen_string_literal: true module Preservation class Client # This wraps any faraday connection errors with preservation-client errors # see https://www.rubydoc.info/gems/faraday/Faraday/ClientError for info on errors class ErrorFaradayMiddleware < Faraday::Middleware def call(env) @app.call(env) rescue Faraday::ConnectionFailed, Faraday::SSLError, Faraday::TimeoutError => e raise ConnectionFailedError, "Unable to reach Preservation Catalog - failed with #{e.class}: #{e.message}" end end end end
Version data entries
11 entries across 11 versions & 1 rubygems