Exception: DurableHuggingfaceHub::CacheNotFoundError

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

Overview

Error raised when the cache directory or cached files are not found.

Examples:

raise CacheNotFoundError.new("/path/to/cache")

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cache_path, message: nil) ⇒ CacheNotFoundError

Creates a new cache not found error.

Parameters:

  • cache_path (String)

    Path to cache directory or file

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

    Custom error message



298
299
300
301
302
# File 'lib/durable_huggingface_hub/errors.rb', line 298

def initialize(cache_path, message: nil)
  @cache_path = cache_path
  message ||= "Cache not found at: #{cache_path}"
  super(message)
end

Instance Attribute Details

#cache_pathString (readonly)

Returns The cache path.

Returns:

  • (String)

    The cache path



292
293
294
# File 'lib/durable_huggingface_hub/errors.rb', line 292

def cache_path
  @cache_path
end