Exception: DurableHuggingfaceHub::EntryNotFoundError

Inherits:
HfHubHTTPError show all
Defined in:
lib/durable_huggingface_hub/errors.rb

Overview

Error raised when a specific file or entry is not found in a repository.

Examples:

raise EntryNotFoundError.new("config.json", repo_id: "bert-base")

Instance Attribute Summary collapse

Attributes inherited from HfHubHTTPError

#request_id, #response_body, #server_message, #status_code

Instance Method Summary collapse

Constructor Details

#initialize(path, repo_id: nil, revision: nil, message: nil) ⇒ EntryNotFoundError

Creates a new entry not found error.

Parameters:

  • path (String)

    File path in repository

  • repo_id (String, nil) (defaults to: nil)

    Repository ID

  • revision (String, nil) (defaults to: nil)

    Revision

  • message (String, nil) (defaults to: nil)

    Custom error message



156
157
158
159
160
161
162
# File 'lib/durable_huggingface_hub/errors.rb', line 156

def initialize(path, repo_id: nil, revision: nil, message: nil)
  @path = path
  @repo_id = repo_id
  @revision = revision
  message ||= build_message
  super(message, status_code: 404)
end

Instance Attribute Details

#pathString (readonly)

Returns The file path that was not found.

Returns:

  • (String)

    The file path that was not found



145
146
147
# File 'lib/durable_huggingface_hub/errors.rb', line 145

def path
  @path
end

#repo_idString? (readonly)

Returns The repository ID.

Returns:

  • (String, nil)

    The repository ID



148
149
150
# File 'lib/durable_huggingface_hub/errors.rb', line 148

def repo_id
  @repo_id
end