Sha256: cbc4c5793c84d8df3046a7c2e75a50bf5bb98b2fd3692e30aa113b02586dc717

Contents?: true

Size: 244 Bytes

Versions: 8

Compression:

Stored size: 244 Bytes

Contents

# frozen_string_literal: true

module DeepL
  module Exceptions
    class BadRequest < RequestError
      def message
        JSON.parse(response.body)['message']
      rescue JSON::ParserError
        response.body
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
deepl-rb-2.5.3 lib/deepl/exceptions/bad_request.rb
deepl-rb-2.5.2 lib/deepl/exceptions/bad_request.rb
deepl-rb-2.5.1 lib/deepl/exceptions/bad_request.rb
deepl-rb-2.5.0 lib/deepl/exceptions/bad_request.rb
deepl-rb-2.4.0 lib/deepl/exceptions/bad_request.rb
deepl-rb-2.3.1 lib/deepl/exceptions/bad_request.rb
deepl-rb-2.3.0 lib/deepl/exceptions/bad_request.rb
deepl-rb-2.2.4 lib/deepl/exceptions/bad_request.rb