Exception: LintTrappings::LintTrappingsError Abstract
- Inherits:
-
StandardError
- Object
- StandardError
- LintTrappings::LintTrappingsError
- Defined in:
- lib/lint_trappings/errors.rb
Overview
This class is abstract.
Abstract error. Separates LintTrappings errors from other kinds of errors in the exception hierarchy.
Direct Known Subclasses
ConfigurationError, LinterError, ParseError, PreprocessorError, ScanFailed, ScanWarned, UsageError
Class Method Summary collapse
-
.exit_status(*args) ⇒ Object
Returns the status code that should be output if this error goes unhandled.
Instance Method Summary collapse
Class Method Details
.exit_status(*args) ⇒ Object
Returns the status code that should be output if this error goes unhandled.
Ideally these should resemble exit codes from the sysexits documentation where it makes sense.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/lint_trappings/errors.rb', line 13 def self.exit_status(*args) if args.any? @exit_status = args.first else if @exit_status @exit_status else ancestors[1..-1].each do |ancestor| return 70 if ancestor == LintTrappingsError # No exit status defined return ancestor.exit_status if ancestor.exit_status end end end end |
Instance Method Details
#exit_status ⇒ Object
28 29 30 |
# File 'lib/lint_trappings/errors.rb', line 28 def exit_status self.class.exit_status end |