Sha256: 479ffe651d6da36f0ae2c791caa042376429a9fa73fcf9852fd6ff7c06735cf2

Contents?: true

Size: 895 Bytes

Versions: 16

Compression:

Stored size: 895 Bytes

Contents

=begin
#Cloudsmith API (v1)

#The API to the Cloudsmith Service

OpenAPI spec version: v1
Contact: support@cloudsmith.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.26

=end

module CloudsmithApi
  class ApiError < StandardError
    attr_reader :code, :response_headers, :response_body

    # Usage examples:
    #   ApiError.new
    #   ApiError.new("message")
    #   ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
    #   ApiError.new(:code => 404, :message => "Not Found")
    def initialize(arg = nil)
      if arg.is_a? Hash
        if arg.key?(:message) || arg.key?('message')
          super(arg[:message] || arg['message'])
        else
          super arg
        end

        arg.each do |k, v|
          instance_variable_set "@#{k}", v
        end
      else
        super arg
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
cloudsmith-api-2.0.15 lib/cloudsmith-api/api_error.rb
cloudsmith-api-2.0.14 lib/cloudsmith-api/api_error.rb
cloudsmith-api-2.0.13 lib/cloudsmith-api/api_error.rb
cloudsmith-api-2.0.12 lib/cloudsmith-api/api_error.rb
cloudsmith-api-2.0.11 lib/cloudsmith-api/api_error.rb
cloudsmith-api-2.0.10 lib/cloudsmith-api/api_error.rb
cloudsmith-api-2.0.9 lib/cloudsmith-api/api_error.rb
cloudsmith-api-2.0.8 lib/cloudsmith-api/api_error.rb
cloudsmith-api-2.0.7 lib/cloudsmith-api/api_error.rb
cloudsmith-api-2.0.6 lib/cloudsmith-api/api_error.rb
cloudsmith-api-2.0.5 lib/cloudsmith-api/api_error.rb
cloudsmith-api-2.0.4 lib/cloudsmith-api/api_error.rb
cloudsmith-api-2.0.3 lib/cloudsmith-api/api_error.rb
cloudsmith-api-2.0.2 lib/cloudsmith-api/api_error.rb
cloudsmith-api-2.0.1 lib/cloudsmith-api/api_error.rb
cloudsmith-api-2.0.0 lib/cloudsmith-api/api_error.rb