Exception: Darkroom::AssetError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/darkroom/errors/asset_error.rb

Overview

General error class used for errors encountered while processing an asset.

Instance Attribute Summary collapse

Instance Method Summary collapse

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(message, 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

#detailObject (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_numObject (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_pathObject (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