Class: OpenWFE::ProcessError
- Inherits:
-
Object
- Object
- OpenWFE::ProcessError
- Defined in:
- lib/openwfe/expool/errorjournal.rb
Overview
Encapsulating process error information.
Instances of this class may be used to replay_at_error
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
When did the error occur.
-
#error_class ⇒ Object
readonly
The error class (String) of the top level error.
-
#fei ⇒ Object
readonly
The FlowExpressionId instance uniquely pointing at the expression which ‘failed’.
-
#message ⇒ Object
readonly
Generally something like :apply or :reply.
-
#stacktrace ⇒ Object
readonly
The String stack trace of the error.
-
#workitem ⇒ Object
readonly
The workitem accompanying the message (apply(workitem) / reply (workitem)).
Instance Method Summary collapse
-
#==(other) ⇒ Object
Returns true if the other instance is a ProcessError and is the same error as this one.
-
#hash ⇒ Object
Returns a hash.
-
#initialize(*args) ⇒ ProcessError
constructor
A new instance of ProcessError.
-
#to_s ⇒ Object
Produces a human readable version of the information in the ProcessError instance.
-
#wfid ⇒ Object
(also: #parent_wfid)
Returns the parent workflow instance id (process id) of this ProcessError instance.
Constructor Details
#initialize(*args) ⇒ ProcessError
89 90 91 92 93 |
# File 'lib/openwfe/expool/errorjournal.rb', line 89 def initialize (*args) @date = Time.new @fei, , @workitem, @error_class, @stacktrace = args end |
Instance Attribute Details
#date ⇒ Object (readonly)
When did the error occur.
60 61 62 |
# File 'lib/openwfe/expool/errorjournal.rb', line 60 def date @date end |
#error_class ⇒ Object (readonly)
The error class (String) of the top level error
87 88 89 |
# File 'lib/openwfe/expool/errorjournal.rb', line 87 def error_class @error_class end |
#fei ⇒ Object (readonly)
The FlowExpressionId instance uniquely pointing at the expression which ‘failed’.
66 67 68 |
# File 'lib/openwfe/expool/errorjournal.rb', line 66 def fei @fei end |
#message ⇒ Object (readonly)
Generally something like :apply or :reply
71 72 73 |
# File 'lib/openwfe/expool/errorjournal.rb', line 71 def end |
#stacktrace ⇒ Object (readonly)
The String stack trace of the error.
82 83 84 |
# File 'lib/openwfe/expool/errorjournal.rb', line 82 def stacktrace @stacktrace end |
#workitem ⇒ Object (readonly)
The workitem accompanying the message (apply(workitem) / reply (workitem)).
77 78 79 |
# File 'lib/openwfe/expool/errorjournal.rb', line 77 def workitem @workitem end |
Instance Method Details
#==(other) ⇒ Object
Returns true if the other instance is a ProcessError and is the same error as this one.
134 135 136 137 138 139 |
# File 'lib/openwfe/expool/errorjournal.rb', line 134 def == (other) return false unless other.is_a?(ProcessError) return to_s == other.to_s # # a bit costly but as it's only used by resume_process()... end |
#hash ⇒ Object
Returns a hash
124 125 126 127 128 |
# File 'lib/openwfe/expool/errorjournal.rb', line 124 def hash to_s.hash # # a bit costly but as it's only used by resume_process()... end |
#to_s ⇒ Object
Produces a human readable version of the information in the ProcessError instance.
109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/openwfe/expool/errorjournal.rb', line 109 def to_s s = "" s << "-- #{self.class.name} --\n" s << " date : #{@date}\n" s << " fei : #{@fei}\n" s << " message : #{@message}\n" s << " workitem : ...\n" s << " error_class : #{@error_class}\n" s << " stacktrace : #{@stacktrace[0, 80]}\n" s end |
#wfid ⇒ Object Also known as: parent_wfid
Returns the parent workflow instance id (process id) of this ProcessError instance.
99 100 101 |
# File 'lib/openwfe/expool/errorjournal.rb', line 99 def wfid @fei.parent_wfid end |