Sha256: d108a6792161427d2b83bf3d301d85894aa4580bfaa76247e8b5f638b5deb73d

Contents?: true

Size: 373 Bytes

Versions: 4

Compression:

Stored size: 373 Bytes

Contents

# Copyright 2022 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 NotFound < 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/not_found.rb
deepl-rb-3.0.2 lib/deepl/exceptions/not_found.rb
deepl-rb-3.0.1 lib/deepl/exceptions/not_found.rb
deepl-rb-3.0.0 lib/deepl/exceptions/not_found.rb