maestro_plugin 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- # Ensure error is written to output file
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
@@ -1,5 +1,5 @@
1
1
  module Maestro
2
2
  module Plugin
3
- VERSION = '0.0.13'
3
+ VERSION = '0.0.14'
4
4
  end
5
5
  end
@@ -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 include('Bad Config')
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 include('PluginError - I had a problem')
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 include('Unexpected error executing task: Exception noooo')
209
+ workitem['__output__'].should be_nil
210
210
  end
211
211
  end
212
212
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: maestro_plugin
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.13
5
+ version: 0.0.14
6
6
  platform: ruby
7
7
  authors:
8
8
  - Etienne Pelletier