Exception: Darkroom::AssetError
- Inherits:
-
StandardError
- Object
- StandardError
- Darkroom::AssetError
- Defined in:
- lib/darkroom/errors/asset_error.rb
Overview
General error class used for errors encountered while processing an asset.
Direct Known Subclasses
AssetNotFoundError, CircularReferenceError, UnrecognizedExtensionError
Instance Attribute Summary collapse
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#source_line_num ⇒ Object
readonly
Returns the value of attribute source_line_num.
-
#source_path ⇒ Object
readonly
Returns the value of attribute source_path.
Instance Method Summary collapse
-
#initialize(message, detail, source_path = nil, source_line_num = nil) ⇒ AssetError
constructor
Public: Create a new instance.
Constructor Details
#initialize(message, detail, source_path = nil, source_line_num = nil) ⇒ AssetError
Public: Create a new instance.
message - String description of the error. detail - String additional error detail. source_path - String path of the asset that contains the error. source_line_num - Integer line number in the asset file where the error was located.
14 15 16 17 18 19 20 |
# File 'lib/darkroom/errors/asset_error.rb', line 14 def initialize(, detail, source_path = nil, source_line_num = nil) super("#{"#{source_path}:#{source_line_num || '?'}: " if source_path}#{message}: #{detail}") @detail = detail @source_path = source_path @source_line_num = source_line_num end |
Instance Attribute Details
#detail ⇒ Object (readonly)
Returns the value of attribute detail.
6 7 8 |
# File 'lib/darkroom/errors/asset_error.rb', line 6 def detail @detail end |
#source_line_num ⇒ Object (readonly)
Returns the value of attribute source_line_num.
6 7 8 |
# File 'lib/darkroom/errors/asset_error.rb', line 6 def source_line_num @source_line_num end |
#source_path ⇒ Object (readonly)
Returns the value of attribute source_path.
6 7 8 |
# File 'lib/darkroom/errors/asset_error.rb', line 6 def source_path @source_path end |