Exception: Proscenium::Builder::BuildError

Inherits:
Error
  • Object
show all
Defined in:
lib/proscenium/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, error) ⇒ BuildError

Returns a new instance of BuildError.



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/proscenium/builder.rb', line 48

def initialize(path, error)
  @path = path
  @error = JSON.parse(error, strict: true)

  msg = @error['Text']
  msg << ' - ' << @error['Detail'] if @error['Detail'].is_a?(String)
  if (location = @error['Location'])
    msg << " at #{location['File']}:#{location['Line']}:#{location['Column']}"
  end

  super("Failed to build #{path} - #{msg}")
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



46
47
48
# File 'lib/proscenium/builder.rb', line 46

def error
  @error
end

#pathObject (readonly)

Returns the value of attribute path.



46
47
48
# File 'lib/proscenium/builder.rb', line 46

def path
  @path
end