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.



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

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.



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

def error
  @error
end

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end