Sha256: 3871f4db60807f1aead9563cdadc8929cd617c40901f4a6e39933863750808cd

Contents?: true

Size: 871 Bytes

Versions: 10

Compression:

Stored size: 871 Bytes

Contents

=begin
#API v1

#FormAPI is a service that helps you fill out and sign PDF templates.

OpenAPI spec version: v1

Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.3.0-SNAPSHOT

=end

module FormAPI
  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

10 entries across 10 versions & 1 rubygems

Version Path
form_api-1.12.0 lib/form_api/api_error.rb
form_api-1.11.0 lib/form_api/api_error.rb
form_api-1.9.1 lib/form_api/api_error.rb
form_api-1.9.0 lib/form_api/api_error.rb
form_api-1.8.0 lib/form_api/api_error.rb
form_api-1.7.0 lib/form_api/api_error.rb
form_api-1.6.0 lib/form_api/api_error.rb
form_api-1.5.0 lib/form_api/api_error.rb
form_api-1.4.1 lib/form_api/api_error.rb
form_api-1.4.0 lib/form_api/api_error.rb