Sha256: f246a6ea38f86b9fadfb7e82ad094f8de57b0f9f1a9943accb4d76ec2ce2bc38

Contents?: true

Size: 474 Bytes

Versions: 7

Compression:

Stored size: 474 Bytes

Contents

module ActionKitRest
  module Response
    class ValidationError < StandardError
      attr_accessor :errors, :url, :body

      def initialize(params)
        self.url = params[:url]
        self.body = params[:body]
        self.errors = JSON.parse(params[:body])['errors']
        super()
      end

      def to_s
        "#{super()} \n url: #{url} \n body: #{body} \n errors: #{errors}"
      end
    end

    class InvalidAkidError < ValidationError
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
action_kit_rest-0.4.2 lib/action_kit_rest/response/validation_error.rb
action_kit_rest-0.4.1 lib/action_kit_rest/response/validation_error.rb
action_kit_rest-0.4.0 lib/action_kit_rest/response/validation_error.rb
action_kit_rest-0.3.8 lib/action_kit_rest/response/validation_error.rb
action_kit_rest-0.3.7 lib/action_kit_rest/response/validation_error.rb
action_kit_rest-0.3.6 lib/action_kit_rest/response/validation_error.rb
action_kit_rest-0.3.5 lib/action_kit_rest/response/validation_error.rb