lib/bolt/transport/base.rb in bolt-0.16.2 vs lib/bolt/transport/base.rb in bolt-0.16.3
- old
+ new
@@ -40,15 +40,18 @@
@logger = Logging.logger[self]
end
def with_events(target, callback)
callback.call(type: :node_start, target: target) if callback
- result = yield
- @logger.debug("Result on #{target.uri}: #{JSON.dump(result.value)}")
+
+ result = begin
+ yield
+ rescue StandardError => ex
+ Bolt::Result.from_exception(target, ex)
+ end
+
callback.call(type: :node_result, result: result) if callback
result
- rescue StandardError => ex
- Bolt::Result.from_exception(target, ex)
end
def filter_options(target, options)
if target.options[:run_as]
options.reject { |k, _v| k == '_run_as' }