Exception: DurableHuggingfaceHub::RepositoryNotFoundError

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

Overview

Error raised when a repository is not found on HuggingFace Hub.

This error occurs when attempting to access a repository that doesn’t exist or when the user doesn’t have permission to access it.

Examples:

# Raised when repository doesn't exist
raise RepositoryNotFoundError.new("organization/nonexistent-model")

Instance Attribute Summary collapse

Attributes inherited from HfHubHTTPError

#request_id, #response_body, #server_message, #status_code

Instance Method Summary collapse

Constructor Details

#initialize(repo_id, message: nil) ⇒ RepositoryNotFoundError

Creates a new repository not found error.

Parameters:

  • repo_id (String)

    Repository ID

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

    Custom error message



98
99
100
101
102
# File 'lib/durable_huggingface_hub/errors.rb', line 98

def initialize(repo_id, message: nil)
  @repo_id = repo_id
  message ||= "Repository not found: #{repo_id}"
  super(message, status_code: 404)
end

Instance Attribute Details

#repo_idString (readonly)

Returns The repository ID that was not found.

Returns:

  • (String)

    The repository ID that was not found



92
93
94
# File 'lib/durable_huggingface_hub/errors.rb', line 92

def repo_id
  @repo_id
end