Sha256: eb6bbb480ac1a780816365b1d1428e6565ed55707b9babaf4ffffe47b81ab444

Contents?: true

Size: 1001 Bytes

Versions: 18

Compression:

Stored size: 1001 Bytes

Contents

# typed: true

module Mangadex
  module Errors
    # Standard error class for this gem.
    # 
    # @author thedrummeraki
    # @since 0.6.0
    class StandardError < ::StandardError
      extend T::Sig
    end

    class UserNotLoggedIn < StandardError
      sig { returns(String) }
      def message
        "You are not logged in. Use [Mangadex::Auth.login] to log in."
      end
    end

    class AuthenticationError < StandardError
      sig { returns(Mangadex::Api::Response) }
      attr_accessor :response

      sig { params(response: Mangadex::Api::Response).void }
      def initialize(response)
        @response = response
      end

      sig { returns(String) }
      def message
        "Your username or password may not be correct."
      end
    end

    class UnauthorizedError < AuthenticationError
      sig { returns(String) }
      def message
        "Oops, you are not authorized to make this call. Make sure you log in with the right account."
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
mangadex-5.10.0 lib/errors.rb
mangadex-5.9.0 lib/errors.rb
mangadex-5.8.0 lib/errors.rb
mangadex-5.7.5.3 lib/errors.rb
mangadex-5.7.5.2 lib/errors.rb
mangadex-5.7.5.1 lib/errors.rb
mangadex-5.7.5 lib/errors.rb
mangadex-5.5.8 lib/errors.rb
mangadex-5.5.6 lib/errors.rb
mangadex-5.4.16 lib/errors.rb
mangadex-5.4.11.3 lib/errors.rb
mangadex-5.4.11.2 lib/errors.rb
mangadex-5.4.11.1 lib/errors.rb
mangadex-5.4.11 lib/errors.rb
mangadex-5.4.9 lib/errors.rb
mangadex-5.3.3.4 lib/errors.rb
mangadex-5.3.3.3 lib/errors.rb
mangadex-5.3.3.2 lib/errors.rb