Exception: DurableHuggingfaceHub::DisabledRepoError

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

Overview

Error raised when attempting to access a disabled repository.

Repositories may be disabled due to policy violations or other reasons.

Examples:

raise DisabledRepoError.new("disabled/repo")

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) ⇒ DisabledRepoError

Creates a new disabled repository error.

Parameters:

  • repo_id (String)

    Repository ID

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

    Custom error message



225
226
227
228
229
# File 'lib/durable_huggingface_hub/errors.rb', line 225

def initialize(repo_id, message: nil)
  @repo_id = repo_id
  message ||= "Repository '#{repo_id}' has been disabled."
  super(message, status_code: 403)
end

Instance Attribute Details

#repo_idString (readonly)

Returns The disabled repository ID.

Returns:

  • (String)

    The disabled repository ID



219
220
221
# File 'lib/durable_huggingface_hub/errors.rb', line 219

def repo_id
  @repo_id
end