Exception: Autobuild::PhaseException
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Autobuild::PhaseException
- Defined in:
- lib/autobuild/exceptions.rb
Overview
Base class for all Autobuild exceptions
Direct Known Subclasses
CommandNotFound, CompositeException, ConfigException, PackageException, SubcommandFailed
Instance Attribute Summary collapse
-
#phase ⇒ Object
Returns the value of attribute phase.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
- #exception_message ⇒ Object
-
#fatal? ⇒ Boolean
If the error is fatal.
-
#initialize(target = nil, phase = nil, options = Hash.new) ⇒ PhaseException
constructor
Creates a new exception which occured while doing phase in target.
-
#mail? ⇒ Boolean
If the error should be reported by mail.
-
#retry? ⇒ Boolean
If the error can be retried.
- #to_s ⇒ Object
Constructor Details
#initialize(target = nil, phase = nil, options = Hash.new) ⇒ PhaseException
Creates a new exception which occured while doing phase in target
22 23 24 25 26 27 28 |
# File 'lib/autobuild/exceptions.rb', line 22 def initialize(target = nil, phase = nil, = Hash.new) = Kernel. , retry: true @target = target @phase = phase @retry = [:retry] super() end |
Instance Attribute Details
#phase ⇒ Object
Returns the value of attribute phase.
18 19 20 |
# File 'lib/autobuild/exceptions.rb', line 18 def phase @phase end |
#target ⇒ Object
Returns the value of attribute target.
18 19 20 |
# File 'lib/autobuild/exceptions.rb', line 18 def target @target end |
Instance Method Details
#exception_message ⇒ Object
30 |
# File 'lib/autobuild/exceptions.rb', line 30 alias to_s |
#fatal? ⇒ Boolean
If the error is fatal
10 11 12 |
# File 'lib/autobuild/exceptions.rb', line 10 def fatal? true end |
#mail? ⇒ Boolean
If the error should be reported by mail
5 6 7 |
# File 'lib/autobuild/exceptions.rb', line 5 def mail? false end |
#retry? ⇒ Boolean
If the error can be retried
15 16 17 |
# File 'lib/autobuild/exceptions.rb', line 15 def retry? @retry end |
#to_s ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/autobuild/exceptions.rb', line 31 def to_s dir = "(#{target.srcdir})" if target.respond_to?(:srcdir) target_name = if target.respond_to?(:name) target.name else target.to_str end if target && phase "#{target_name}#{dir}: failed in #{phase} phase\n #{super}" elsif target "#{target_name}#{dir}: #{super}" else super end end |