class Darkroom::AssetError
General error class used for errors encountered while processing an asset.
Attributes
detail[R]
source_line_num[R]
source_path[R]
Public Class Methods
new(message, detail, source_path = nil, source_line_num = nil)
click to toggle source
Creates a new instance.
-
message
- Description of the error. -
detail
- Additional detail about the error. -
source_path
- Path of the asset that contains the error (optional). -
source_line_num
- Line number in the asset where the error is located (optional).
Calls superclass method
# File lib/darkroom/errors/asset_error.rb, line 18 def initialize(message, detail, source_path = nil, source_line_num = nil) super(message) @detail = detail @source_path = source_path @source_line_num = source_line_num end
Public Instance Methods
to_s()
click to toggle source
Returns a string representation of the error.
# File lib/darkroom/errors/asset_error.rb, line 29 def to_s "#{"#{@source_path}:#{@source_line_num || '?'}: " if @source_path}#{super}: #{@detail}" end