Exception: Laser::Error
- Inherits:
-
StandardError
- Object
- Exception
- StandardError
- Laser::Error
- Defined in:
- lib/laser/analysis/errors.rb
Overview
Base class for all Laser errors. Has a few fields that are important for later referencing during error reporting.
Direct Known Subclasses
Analysis::Scope::ScopeLookupFailure, ConstantInForLoopError, DangerousOverrideError, DeadCodeWarning, DiscardedRHSError, DoubleIncludeError, DynamicSuperclassError, FailedAliasError, ImproperOverrideTypeError, IncompatibleArityError, MissingBlockError, NoMatchingTypeSignature, NoSuchMethodError, NotInMethodError, OverrideWithoutSuperError, ReopenedClassAsModuleError, ReopenedModuleAsClassError, SuperclassMismatchError, TopLevelSimulationRaised, UnassignedLHSError, UnnecessaryBlockError, UnusedVariableWarning
Constant Summary
- ADVISORY =
1- STYLE =
2- MINOR_WARNING =
3- WARNING =
4- MAJOR_WARNING =
5- SIMPLE_ERROR =
6- ERROR =
7- TRICKY_ERROR =
8- MAJOR_ERROR =
9- FUCKUP =
10
Constants inherited from Exception
Instance Attribute Summary (collapse)
-
- (Object) ast_node
Returns the value of attribute ast_node.
-
- (Object) severity
Returns the value of attribute severity.
Class Method Summary (collapse)
Instance Method Summary (collapse)
- - (Object) ==(other)
-
- (Error) initialize(message, ast_node, severity = 5)
constructor
A new instance of Error.
- - (Object) inspect
- - (Object) line_number
Methods inherited from Exception
#backtrace, #set_backtrace, #to_s
Constructor Details
- (Error) initialize(message, ast_node, severity = 5)
A new instance of Error
23 24 25 26 |
# File 'lib/laser/analysis/errors.rb', line 23 def initialize(, ast_node, severity = 5) super() @ast_node, @severity = ast_node, severity end |
Instance Attribute Details
- (Object) ast_node
Returns the value of attribute ast_node
22 23 24 |
# File 'lib/laser/analysis/errors.rb', line 22 def ast_node @ast_node end |
- (Object) severity
Returns the value of attribute severity
22 23 24 |
# File 'lib/laser/analysis/errors.rb', line 22 def severity @severity end |
Class Method Details
+ (Object) severity(new_severity)
16 17 18 19 20 |
# File 'lib/laser/analysis/errors.rb', line 16 def self.severity(new_severity) define_method :initialize do |msg, node| super(msg, node, new_severity) end end |
Instance Method Details
- (Object) ==(other)
28 29 30 31 |
# File 'lib/laser/analysis/errors.rb', line 28 def ==(other) other.class == self.class && other. == self. && other.ast_node == self.ast_node && self.severity == other.severity end |
- (Object) inspect
37 38 39 |
# File 'lib/laser/analysis/errors.rb', line 37 def inspect "#<#{self.class}: #{} (#{ast_node.file_name}:#{ast_node.source_begin[0]})>" end |
- (Object) line_number
33 34 35 |
# File 'lib/laser/analysis/errors.rb', line 33 def line_number ast_node.line_number end |