Exception: Kotoshu::ResourceNotCachedError

Inherits:
Error
  • Object
show all
Defined in:
lib/kotoshu/core/exceptions.rb

Overview

Error raised when a required resource is not cached and cannot be downloaded (offline mode or network failure).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(language, resource_type) ⇒ ResourceNotCachedError

Returns a new instance of ResourceNotCachedError.



107
108
109
110
111
112
113
# File 'lib/kotoshu/core/exceptions.rb', line 107

def initialize(language, resource_type)
  @language = language
  @resource_type = resource_type
  super("Resource not cached: #{language}:#{resource_type}. " \
        "Pre-fetch with `kotoshu cache download language #{language}` " \
        "or disable offline mode (KOTOSHU_OFFLINE=0).")
end

Instance Attribute Details

#languageObject (readonly)

Returns the value of attribute language.



115
116
117
# File 'lib/kotoshu/core/exceptions.rb', line 115

def language
  @language
end

#resource_typeObject (readonly)

Returns the value of attribute resource_type.



115
116
117
# File 'lib/kotoshu/core/exceptions.rb', line 115

def resource_type
  @resource_type
end