Sha256: b6dbf732bfdae9c145d5c46aec41677b5169bb5ed80f9d96019c9a166b1d541b

Contents?: true

Size: 375 Bytes

Versions: 4

Compression:

Stored size: 375 Bytes

Contents

# Copyright 2018 Daniel Herzog
# Use of this source code is governed by an MIT
# license that can be found in the LICENSE.md file.
# 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

4 entries across 4 versions & 1 rubygems

Version Path
deepl-rb-3.1.0 lib/deepl/exceptions/bad_request.rb
deepl-rb-3.0.2 lib/deepl/exceptions/bad_request.rb
deepl-rb-3.0.1 lib/deepl/exceptions/bad_request.rb
deepl-rb-3.0.0 lib/deepl/exceptions/bad_request.rb