Enable regular error handling.
554383
public function enableRecoverableErrorHandling() {
        if ($this->isRecoverableErrorHandlingEnabled()) {
            return;
        }

        set_error_handler(function ($number, $string, $file, $line) {
            // remove error from error_get_last()
            @trigger_error(null);

            return $this->errorConverter->createRecoverableErrorAndCallHandler(
                $this, $number, $string, $file, $line
            );
        });
        $this->isRecoverableErrorHandlingEnabled = true;
    }
684015
def _default_error_handler(msg, _):
    """"""
    msg = "OpenJPEG library error:  {0}".format(msg.decode('utf-8').rstrip())
    opj2.set_error_message(msg)
74361
def error_handler(exception_cls, response):
    """"""
    # Responses are sent as html. Split on the newlines and give us
    # the <p> text back.
    error = convert_response_to_text(response)
    exception = exception_cls("Response Code: %s\tResponse: %s" %
                              (response.status_code, error))
    exception.status_code = response.status_code
    raise exception
739669
public function setHandlers()
    {
        $error = configItem('error');

        if ($error == 0)
        {
            ini_set('display_errors', 0);
            error_reporting(0);
        }
        else if ($error == 2)
        {
            error_reporting(0);
            set_error_handler(array($this, 'captureNormal'));
            set_exception_handler(array($this, 'captureException'));
            register_shutdown_function(array($this, 'captureShutdown'));

        }
        else if ($error == 1)
        {
            error_reporting(E_ALL);
            ini_set('display_errors', 1);
        }
    }
351021
def _handle_error(self, data, params):
        """"""
        error = data.get('error', 'API call failed')
        mode = params.get('mode')
        raise SabnzbdApiException(error, mode=mode)
937951
def err(self, output, newline=True):
        """"""
        click.echo(output, nl=newline, err=True)
1337615
function handleError(err) {
  let errMsg = err;

  if (err instanceof Object) {
    errMsg = err.message || err.error || JSON.stringify(err);
  }

  printColumns(chalk.red('Error: ' + errMsg));
  printColumns(
    chalk.white(
      "If you can't settle this, please open an issue at:" + EOL + chalk.cyan(pkg.bugs.url)
    )
  );
  process.exit(1);
}
610854
def setup_errors(app, error_template="error.html"):
    """"""
    def error_handler(error):
        if isinstance(error, HTTPException):
            description = error.get_description(request.environ)
            code = error.code
            name = error.name
        else:
            description = error
            code = 500
            name = "Internal Server Error"
        return render_template(error_template,
                               error=error,
                               code=code,
                               name=Markup(name),
                               description=Markup(description)), code

    for exception in default_exceptions:
        app.register_error_handler(exception, error_handler)
1102148
def _handle_errors(errors):
  """"""
  if not errors:
    return
  log_all = True  # pylint: disable=unused-variable
  err_msg = "T2T: skipped importing {num_missing} data_generators modules."
  print(err_msg.format(num_missing=len(errors)))
  for module, err in errors:
    err_str = str(err)
    if not _is_import_err_msg(err_str, module):
      print("From module %s" % module)
      raise err
    if log_all:
      print("Did not import module: %s; Cause: %s" % (module, err_str))
914468
def handle_errors(callback, parsed=None, out=sys.stderr):

    """"""

    try:
        if parsed:
            return callback(parsed)
        else:
            return callback()
    except DeploymentError as e:
        traceback.print_exc(file=out)
        print(e, file=out)
        if hasattr(e, 'value') and hasattr(e.value, 'args') and len(e.value.args) > 0 and \
                'open_sftp_client' in e.value.args[0]:
            print('Timeout', file=out)
            return TIMEOUT
        return DEPLOYMENT_ERROR
    except MalformedResponseError as e:
        traceback.print_exc(file=out)
        print(e, file=out)
        if 'Service Unavailable' in e.body:
            return SERVICE_UNAVAILABLE
        return MALFORMED_RESPONSE
    except SystemExit:
        pass
    except:
        traceback.print_exc(file=out)
        return EXCEPTION
940128
public static function setEnvironment(): void
    {
        error_reporting(E_ALL);
        set_error_handler(function ($errno, $errstr, $errfile, $errline, array $errcontext): bool {
            if (!(error_reporting() & $errno)) {
                // respect error_reporting() level
                // libraries used in custom components may emit notices that cannot be fixed
                return false;
            }

            throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
        });
    }
1185184
def add_error_handler(self, error_input):
        

        if isinstance(error_input, dict):
            error_response = error_input.get('response', {})
            cerr = error_response.get('command_error', NoResponse)
            qerr = error_response.get('query_error', NoResponse)

            response_dict = {'command_error': cerr,
                             'query_error': qerr}

            register_list = error_input.get('status_register', [])

            for register_dict in register_list:
                query = register_dict['q']
                register = StatusRegister(register_dict)
                self._status_registers[to_bytes(query)] = register
                for key in register.keys():
                    self._error_map[key] = register

            queue_list = error_input.get('error_queue', [])

            for queue_dict in queue_list:
                query = queue_dict['q']
                err_queue = ErrorQueue(queue_dict)
                self._error_queues[to_bytes(query)] = err_queue

        else:
            response_dict = {'command_error': error_input,
                             'query_error': error_input}

        for key, value in response_dict.items():
            self._error_response[key] = to_bytes(value)
674128
def allow_events(self, mode, time, onerror = None):
        """"""
        request.AllowEvents(display = self.display,
                            onerror = onerror,
                            mode = mode,
                            time = time)
217170
def handle_error(self, error, req, schema, error_status_code, error_headers):
        """"""
        status = status_map.get(error_status_code or self.DEFAULT_VALIDATION_STATUS)
        if status is None:
            raise LookupError("Status code {0} not supported".format(error_status_code))
        raise HTTPError(status, errors=error.messages, headers=error_headers)
1029483
def handle_error(self, error, req, schema, error_status_code, error_headers):
        
        status_code = error_status_code or self.DEFAULT_VALIDATION_STATUS
        raise bottle.HTTPError(
            status=status_code,
            body=error.messages,
            headers=error_headers,
            exception=error,
        )
783331
protected function setErrorReporting()
    {
        /**
         * Configure how verbose PHP is; Everything except E_STRICT and E_ERROR;
         * we'll let the errorHandler pick up fatal errors
         */

        error_reporting(E_ALL ^ E_STRICT ^ E_ERROR);

        //  Configure whether errors are shown or no
        if (function_exists('ini_set')) {
            switch (Environment::get()) {
                case Environment::ENV_PROD:
                    //  Suppress all errors on production
                    ini_set('display_errors', false);
                    break;
                default:
                    //  Show errors everywhere else
                    ini_set('display_errors', true);
                    break;
            }
        }
    }
1281151
def handle_error(self):
        """"""
        if self.server.can_ignore_error(self):
            return
        if thread_local.status_code is None:
            msg("ERROR: Cannot send error status code! " +
                "Header already sent!\n{0}", traceback.format_exc())
        else:
            msg("ERROR: Error while processing request:\n{0}",
                traceback.format_exc())
            try:
                self.send_error(500, "Internal Error")
            except:  # nopep8
                if self.server.can_ignore_error(self):
                    return
                msg("ERROR: Cannot send error status code:\n{0}",
                    traceback.format_exc())