Exception: Benoit::CompilerError

Inherits:
StandardError show all
Defined in:
lib/benoit/compiler_error.rb

Direct Known Subclasses

FileMissingError

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from StandardError

#type

Constructor Details

#initialize(line, file_path, original_error) ⇒ CompilerError

Returns a new instance of CompilerError.



26
27
28
29
30
31
32
# File 'lib/benoit/compiler_error.rb', line 26

def initialize(line, file_path, original_error)
    @line = line
    @file_path = file_path
    @output = output
    @env = env
    @original_error = original_error
end

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env.



24
25
26
# File 'lib/benoit/compiler_error.rb', line 24

def env
  @env
end

#file_pathObject (readonly)

Returns the value of attribute file_path.



24
25
26
# File 'lib/benoit/compiler_error.rb', line 24

def file_path
  @file_path
end

#lineObject

Returns the value of attribute line.



23
24
25
# File 'lib/benoit/compiler_error.rb', line 23

def line
  @line
end

#messageObject

Returns the value of attribute message.



23
24
25
# File 'lib/benoit/compiler_error.rb', line 23

def message
  @message
end

#original_errorObject (readonly)

Returns the value of attribute original_error.



24
25
26
# File 'lib/benoit/compiler_error.rb', line 24

def original_error
  @original_error
end

#outputObject (readonly)

Returns the value of attribute output.



24
25
26
# File 'lib/benoit/compiler_error.rb', line 24

def output
  @output
end

Instance Method Details

#to_jsonObject



38
39
40
# File 'lib/benoit/compiler_error.rb', line 38

def to_json
  { line_no: @line, message: @message, path: @file_path, original_error: @original_error, type: "error" }.to_json
end