A wrapper around the original +#execute+, that catches all errors and
 notifies Airbrake.

 rubocop:disable Lint/RescueException
194644
def execute(args = nil)
      execute_without_airbrake(args)
    rescue Exception => ex
      notify_airbrake(ex, args)
      raise ex
    end
175188
def error_rendering(exception, symbol)
      Rails.logger.error exception

      @exception = exception
      @symbol = symbol
      @code = Rack::Utils::SYMBOL_TO_STATUS_CODE[symbol].to_i
      respond_with @exception, status: @code, template: ERROR_PATH, prefixes: _prefixes
    end
39311
function errnoException(err, syscall, original) {
  // TODO(joyeecheung): We have to use the type-checked
  // getSystemErrorName(err) to guard against invalid arguments from users.
  // This can be replaced with [ code ] = errmap.get(err) when this method
  // is no longer exposed to user land.
  if (util === undefined) util = require('util');
  const code = util.getSystemErrorName(err);
  const message = original ?
    `${syscall} ${code} ${original}` : `${syscall} ${code}`;

  // eslint-disable-next-line no-restricted-syntax
  const ex = new Error(message);
  // TODO(joyeecheung): errno is supposed to err, like in uvException
  ex.code = ex.errno = code;
  ex.syscall = syscall;

  Error.captureStackTrace(ex, errnoException);
  return ex;
}
869614
def run
      # We can't just rescue exception because Firefox automatically closes alert when exception raised
      return unless @after_hooks.any? && !@browser.alert.exists?

      each { |after_hook| after_hook.call(@browser) }
    rescue Selenium::WebDriver::Error::NoSuchWindowError => ex
      Watir.logger.info "Could not execute After Hooks because browser window was closed #{ex}"
    end
1170953
def _method_error_handler(self, response: Dict[str, Any]):
        
        exp = response.get('MESSAGE')
        code = response.get("CODE")
        ID = exp.get("ID")
        raise abort(code, ID=ID, message=exp.get('MESSAGE'))
1207620
def unhandled(exception, opt):
    
    exmod = type(exception).__module__
    name = "%s.%s" % (exmod, type(exception).__name__)
    # this is a Vault error
    if exmod == 'aomi.exceptions' or exmod == 'cryptorito':
        # This may be set for Validation or similar errors
        if hasattr(exception, 'source'):
            output(exception.message, opt, extra=exception.source)
        else:
            output(exception.message, opt)

    else:
        output("Unexpected error: %s" % name, opt)

    sys.exit(1)
1284650
def _method_error_handler(self, response: Dict[str, Any]):
        
        exp = response.get('MESSAGE')
        code = response.get("CODE")
        ID = exp.get("ID")
        e = abort(code, ID=ID, message=exp.get('MESSAGE'))
        self.tasks[ID].set_exception(e)
        return True
1100762
def execute!
      exit_code = begin
        # Thor accesses these streams directly rather than letting them be injected, so we replace them...
        $stderr = @stderr
        $stdin = @stdin
        $stdout = @stdout

        # Run our normal Thor app the way we know and love.
        DCMetro::Cli::Application.start(ARGV)

        # Thor::Base#start does not have a return value, assume success if no exception is raised.
        0
      rescue StandardError => e
        # The ruby interpreter would pipe this to STDERR and exit 1 in the case of an unhandled exception
        b = e.backtrace
        @stderr.puts("#{b.shift}: #{e.message} (#{e.class})")
        @stderr.puts(b.map{|s| "\tfrom #{s}"}.join("\n"))
        1
      rescue SystemExit => e
        e.status
      ensure
        # TODO: reset your app here, free up resources, etc.
        # Examples:
        # MyApp.logger.flush
        # MyApp.logger.close
        # MyApp.logger = nil
        #
        # MyApp.reset_singleton_instance_variables

        # ...then we put the streams back.
        $stderr = STDERR
        $stdin = STDIN
        $stdout = STDOUT
      end

      # Proxy our exit code back to the injected kernel.
      @kernel.exit(exit_code)
    end
1333141
def execute_catch(c, sql, vars=None):
    """"""
    try:
        c.execute(sql, vars)
    except Exception as err:
        cmd = sql.split(' ', 1)[0]
        log.error("Error executing %s: %s", cmd, err)
1336028
def syntax_error!(message)
      raise SyntaxError.new(message, options[:file], @orig_line, @lineno,
                            @orig_line && @line ? @orig_line.size - @line.size : 0)
    rescue SyntaxError => ex
      # HACK: Manipulate stacktrace for Rails and other frameworks
      # to find the right file.
      ex.backtrace.unshift "#{options[:file]}:#{@lineno}"
      raise
    end
665102
def _server_error_handler(self, code: int):
        
        if code == 501:
            self._login_fut.set_result(False)
        else:
            self.clean()
            raise abort(code)
        return True
501467
def execute(*)
      file, line, = caller.first.split(":")
      colors = SSHKit::Color.new($stderr)
      $stderr.puts colors.colorize("Warning: `execute' should be wrapped in an `on' scope in #{file}:#{line}.", :red)
      $stderr.puts
      $stderr.puts "  task :example do"
      $stderr.puts colors.colorize("    on roles(:app) do", :yellow)
      $stderr.puts "      execute 'whoami'"
      $stderr.puts colors.colorize("    end", :yellow)
      $stderr.puts "  end"
      $stderr.puts
      raise NoMethodError, "undefined method `execute' for main:Object"
    end
1024940
def base_exception_handler(*args):
    

    header, frames, trcback = format_report(*extract_exception(*args))

    LOGGER.error("!> {0}".format(Constants.logging_separators))
    map(lambda x: LOGGER.error("!> {0}".format(x)), header)

    LOGGER.error("!> {0}".format(Constants.logging_separators))
    map(lambda x: LOGGER.error("!> {0}".format(x)), frames)

    LOGGER.error("!> {0}".format(Constants.logging_separators))
    sys.stderr.write("\n".join(trcback))

    return True
447597
def exception_handler(self, ex):  # pylint: disable=no-self-use
        
        if isinstance(ex, CLIError):
            logger.error(ex)
        else:
            logger.exception(ex)
        return 1
615603
def dump_error(error)
			error_message = [
				"#{Time.now.strftime('%Y-%m-%d %H:%M:%S')} - " \
				"#{error.class} - #{error.message}:",
				*error.backtrace
			].join("\n\t")
			@env[Rack::RACK_ERRORS].puts(error_message)
		end
537849
def execute_sample(to_execute, source: nil)
      # Disable some annoying warning by ruby. We are testing edge cases, so warnings are to be expected.
      Tools.silence_warnings do
        if to_execute.is_a?(CoveredCode)
          to_execute.execute_code
        else
          to_execute.call
        end
      end
      true
    rescue StandardError => e
      # In our samples, a simple `raise` is expected and doesn't need to be rescued
      return false if e.is_a?(RuntimeError) && e.message.empty?

      source = to_execute.covered_source if to_execute.is_a?(CoveredCode)
      raise unless source

      inner_msg = Tools.indent_string("#{e.class.name}: #{e.message}", 4)
      source = Tools.indent_string(source, 4)
      msg = "Exception when executing the sample:\n#{inner_msg}\n*Code follows*\n#{source}"
      new_exc = ExceptionInSample.new(msg)
      new_exc.set_backtrace(e.backtrace)
      raise new_exc
    end
1310202
def error_handler(self, error):
        
        warnings.warn(
            """
            error_handler is deprecated.
            Use FlaskBuzz.build_error_handler instead
            """,
            warnings.DeprecationWarning,
        )
        return error.jsonify(), error.status_code, error.headers