Sha256: 81923296000ffb4b366f76cd208f94ffb5be0bd7536a5d2c1120935d79d568ea
Contents?: true
Size: 1.17 KB
Versions: 70
Compression:
Stored size: 1.17 KB
Contents
module Fog module OpenStack module Errors class ServiceError < Fog::Errors::Error attr_reader :response_data def self.slurp(error) if error.response.body.empty? data = nil message = nil else data = Fog::JSON.decode(error.response.body) message = data['message'] if message.nil? and !data.values.first.nil? message = data.values.first['message'] end end new_error = super(error, message) new_error.instance_variable_set(:@response_data, data) new_error end end class ServiceUnavailable < ServiceError; end class BadRequest < ServiceError attr_reader :validation_errors def self.slurp(error) new_error = super(error) unless new_error.response_data.nil? or new_error.response_data['badRequest'].nil? new_error.instance_variable_set(:@validation_errors, new_error.response_data['badRequest']['validationErrors']) end new_error end end class InterfaceNotImplemented < Fog::Errors::Error; end end end end
Version data entries
70 entries across 68 versions & 5 rubygems