Sha256: 61d87c163343d7b156dc5b94857ab85e5d737dbf8454774f2e2cb0dec2f539c8

Contents?: true

Size: 736 Bytes

Versions: 6

Compression:

Stored size: 736 Bytes

Contents

module LaunchDarkly
  module Util
    def self.log_exception(logger, message, exc)
      logger.error { "[LDClient] #{message}: #{exc.inspect}" }
      logger.debug { "[LDClient] Exception trace: #{exc.backtrace}" }
    end

    def self.http_error_recoverable?(status)
      if status >= 400 && status < 500
        status == 400 || status == 408 || status == 429
      else
        true
      end
    end

    def self.http_error_message(status, context, recoverable_message)
      desc = (status == 401 || status == 403) ? " (invalid SDK key)" : ""
      message = Util.http_error_recoverable?(status) ? recoverable_message : "giving up permanently"
      "HTTP error #{status}#{desc} for #{context} - #{message}"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ldclient-rb-5.4.3 lib/ldclient-rb/util.rb
ldclient-rb-5.4.2 lib/ldclient-rb/util.rb
ldclient-rb-5.4.1 lib/ldclient-rb/util.rb
ldclient-rb-5.3.0 lib/ldclient-rb/util.rb
ldclient-rb-5.2.0 lib/ldclient-rb/util.rb
ldclient-rb-5.1.0 lib/ldclient-rb/util.rb