Sha256: b1bd6ed8efacd760ae858109721b4aafda899eb537bf6fd8b74caf5af6421437
Contents?: true
Size: 678 Bytes
Versions: 22
Compression:
Stored size: 678 Bytes
Contents
require "json" module Flipper module Adapters class Http class Error < StandardError attr_reader :response def initialize(response) @response = response message = "Failed with status: #{response.code}" begin data = JSON.parse(response.body) if error_message = data["message"] message << "\n\n#{data["message"]}" end if more_info = data["more_info"] message << "\n#{data["more_info"]}" end rescue => exception # welp we tried end super(message) end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems