Method: Arrow::Broker#run_error_handler
- Defined in:
- lib/arrow/broker.rb
#run_error_handler(applet, txn, err) ⇒ Object
Handle the given applet error err for the specified applet, using the given transaction txn. This will attempt to run whatever applet is configured as the error-handler, or run a builtin handler applet if none is configured or the configured one isn’t loaded.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/arrow/broker.rb', line 134 def run_error_handler( applet, txn, err ) rval = nil handlerName = @config.applets.errorApplet.sub( %r{^/}, '' ) unless handlerName == "(builtin)" or !@registry.key?( handlerName ) handler = @registry[handlerName] self.log.notice "Running error handler applet '%s' (%s)" % [ handler.signature.name, handlerName ] begin rval = handler.run( txn, "report_error", applet, err ) rescue ::Exception => err2 self.log.error "Error while attempting to use custom error "\ "handler '%s': %s\n\t%s" % [ handler.signature.name, err2., err2.backtrace.join("\n\t"), ] rval = self.builtin_error_handler( applet, txn, err ) end else rval = self.builtin_error_handler( applet, txn, err ) end return rval end |