maestro_plugin 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -103,14 +103,13 @@ module Maestro
|
|
103
103
|
write_output('') # Triggers any remaining buffered output to be sent
|
104
104
|
run_callbacks
|
105
105
|
rescue MaestroDev::Plugin::PluginError => e
|
106
|
-
#
|
107
|
-
write_output(e.message)
|
106
|
+
write_output('') # Triggers any remaining buffered output to be sent
|
108
107
|
set_error(e.message)
|
109
108
|
rescue Exception => e
|
109
|
+
write_output('') # Triggers any remaining buffered output to be sent
|
110
110
|
lowerstack = e.backtrace.find_index(caller[0])
|
111
111
|
stack = lowerstack ? e.backtrace[0..lowerstack - 1] : e.backtrace
|
112
112
|
msg = "Unexpected error executing task: #{e.class} #{e} at\n" + stack.join("\n")
|
113
|
-
write_output(msg)
|
114
113
|
Maestro.log.warn("#{msg}\nFull stack:\n" + e.backtrace.join("\n"))
|
115
114
|
|
116
115
|
# Let user-supplied exception handler do its thing
|
data/spec/maestro_worker_spec.rb
CHANGED
@@ -190,7 +190,7 @@ describe Maestro::MaestroWorker do
|
|
190
190
|
|
191
191
|
@worker.perform(:configerror_test, workitem)
|
192
192
|
workitem['fields']['__error__'].should include('Bad Config')
|
193
|
-
workitem['__output__'].should
|
193
|
+
workitem['__output__'].should be_nil
|
194
194
|
end
|
195
195
|
|
196
196
|
it 'should handle a PluginError' do
|
@@ -198,7 +198,7 @@ describe Maestro::MaestroWorker do
|
|
198
198
|
|
199
199
|
@worker.perform(:pluginerror_test, workitem)
|
200
200
|
workitem['fields']['__error__'].should include('PluginError - I had a problem')
|
201
|
-
workitem['__output__'].should
|
201
|
+
workitem['__output__'].should be_nil
|
202
202
|
end
|
203
203
|
|
204
204
|
it 'should handle an unexpected Error' do
|
@@ -206,7 +206,7 @@ describe Maestro::MaestroWorker do
|
|
206
206
|
|
207
207
|
@worker.perform(:error_test, workitem)
|
208
208
|
workitem['fields']['__error__'].should include('Unexpected error executing task: Exception noooo')
|
209
|
-
workitem['__output__'].should
|
209
|
+
workitem['__output__'].should be_nil
|
210
210
|
end
|
211
211
|
end
|
212
212
|
end
|