Send the exception to Mission control.

@param Exeption $exception

@return bool
976179
public function exception($exception)
    {
        $headers = [
            'token' => $this->token,
        ];

        if (is_null($this->token)) {
            throw new Exception("Missing token", 1);
        }

        $query = $this->processException($exception);

        $response = $this->curl::post($this->missionControlUrl, $headers, $query);

        if ($response->code != 200) {
            $this->error('Unable to message Mission Control, please confirm your token');
        }

        return true;
    }
1337002
public function isAllowed($exception)
    {
        if (empty($exception) || !$exception instanceof \Exception) {
            return true;
        }

        if (!empty($this->blacklist)) {
            foreach ($this->blacklist as $excType) {
                if (is_a($exception, $excType, true)) {
                    return false;
                }
            }
        }

        return true;
    }
399812
static public function exceptionHandler(\Exception $exception)
    {

        $errorFullText = self::formatExceptionMessage($exception);

        if (self::$displayErrors) {
            echo self::displayBox();
        }

        if (self::$displayTrace) {
            echo self::formatError($errorFullText);
        }

        if (self::$sendTrace) {
            self::send($errorFullText);
        }

    }
616021
static public function sendException($exception, $description = ''){
		if (!sfConfig::get('app_amg_sentry_enabled', false)) {
			return true;
		}
		return self::getInstance()->captureException($exception, $description);
	}
900745
protected function logException(\Exception $exception)
    {
        try {
            $this->logger->error($exception->getMessage() , array('exception' => $exception));
        } catch (\Exception $exception) {
            trigger_error("Error logging Monitor exception: ".$exception->getMessage());
        }
    }
99373
public function handle(Exception $ex) {
        if ( ! $this->supports($ex)) {
            return false;
        }

        $handled = $this->invokeHandler($this->getHandler(), $ex);

        return $handled === true ? true : false;
    }
33774
public function exceptionHandler(Exception $ex)
    {
        return $this->errorHandler(E_USER_ERROR, $ex->getMessage(), $ex->getFile(), $ex->getLine());
    }
455858
public function fromException( Exception $exception )
    {
        return $this->generateResponse(
            xmlrpc_encode_request(
                null,
                array(
                    'faultCode' => $exception->getCode(),
                    'faultString' => $exception->getMessage()
                )
            )
        );
    }
1284129
protected function doException(\Exception $e)
    {
        $command = new DefaultConsoleCommand();
        $command->data = '"Error #' . $e->getCode() . ' - ' . $e->getMessage() . '"';
        $command->execute();

        $response = (new ResponseInjector)->build();
        $response = $response->withHeader('status', (string)(int)$command->result); // TODO: hack for select cli stream

        $stream = $response->getBody();
        $stream->write($command->message);

        return $response->withBody($stream);
    }
261608
public function send()
    {
        if (!$this->from) {
            throw new \Exception('Message sender has not been set');
        }

        if (!$this->body) {
            throw new \Exception('Message body has not been set');
        }

        if (!$this->to) {
            throw new \Exception('Message receiver has not been set');
        }

        $command = new SendMessageCommand($this->to, $this->body, $this->from, $this->type);

        return $this->commandBus->execute($command);
    }
562624
public function sendPerformance()
    {
        $headers = [
            'token' => $this->token,
        ];

        if (is_null($this->token)) {
            throw new Exception("Missing token", 1);
        }

        $query = $this->getPerformance();

        $response = $this->curl::post($this->missionControlUrl, $headers, $query);

        if ($response->code != 200) {
            $this->error('Unable to message Mission Control, please confirm your token');
        }

        return true;
    }
39666
protected function handleErrorException(\ErrorException $exception)
    {
        switch ($exception->getSeverity()) {
            case E_ERROR:
            case E_RECOVERABLE_ERROR:
            case E_CORE_ERROR:
            case E_COMPILE_ERROR:
            case E_USER_ERROR:
            case E_PARSE:
                $this->logger->error($this->buildLogMessage($exception));
                break;

            case E_WARNING:
            case E_USER_WARNING:
            case E_CORE_WARNING:
            case E_COMPILE_WARNING:
                $this->logger->warning($this->buildLogMessage($exception));
                break;

            case E_NOTICE:
            case E_USER_NOTICE:
                $this->logger->notice($this->buildLogMessage($exception));
                break;

            case E_STRICT:
            case E_DEPRECATED:
            case E_USER_DEPRECATED:
                $this->logger->info($this->buildLogMessage($exception));
                break;
        }

        return true;
    }
330481
public function _handleException($exception)
    {
        $result = false;

        if($this->isEnabled(self::TYPE_EXCEPTION))
        {
            //Handle \Error Exceptions in PHP7
            if (class_exists('Error') && $exception instanceof \Error)
            {
                $message = $exception->getMessage();
                $file    = $exception->getFile();
                $line    = $exception->getLine();
                $type    = E_ERROR; //Set to E_ERROR by default

                if($exception instanceof \DivisionByZeroError) {
                    $type = E_WARNING;
                }

                if($exception instanceof \AssertionError) {
                    $type = E_WARNING;
                }

                if($exception instanceof \ParseError) {
                    $type = E_PARSE;
                }

                if($exception instanceof \TypeError) {
                    $type =  E_RECOVERABLE_ERROR;
                }

                $result = $this->_handleError($type, $message, $file, $line, null, $exception);
            }
            else $result = $this->handleException($exception);
        }

        //Let the normal error flow continue
        return $result;
    }
952632
protected function shouldMail(Exception $exception)
    {
        // if emailing is turned off in the config
        if (config('laravelEmailExceptions.ErrorEmail.email') != true ||

            // if we dont have an email address to mail to
            !config('laravelEmailExceptions.ErrorEmail.toEmailAddress') ||

            // if we dont have an email address to mail from
            !config('laravelEmailExceptions.ErrorEmail.fromEmailAddress') ||

            $this->shouldntReport($exception) ||

            // if the exception is in the don't mail list
            $this->isInDontEmailList($exception) ||

            // if there is any app specific don't email logic
            $this->appSpecificDontEmail($exception) ||

            // if the exception has already been mailed within the last throttle period
            $this->throttle($exception) ||

            // if we've already sent the maximum amount of emails for the global throttle period
            $this->globalThrottle()
        ) {
            // we should not mail this exception
            return false;
        }

        // we made it past all the possible reasons to not email so we should mail this exception
        return true;
    }
310726
public static function printException(\Exception $ex)
    {
        $msg="code:".$ex->getCode()
            ."\r\nmessage:".$ex->getMessage()
            ."\r\ntrace:".$ex->getTraceAsString();
        self::printLine($msg);
    }
1098703
public function handleException(Exception $exception) {
        // untangle message from php7errorexception
        $message = $exception instanceof PHP7ErrorException ? $exception->getError()->getMessage(): $exception->getMessage();

        // send a debug mail with the exception
        if(!$this->debug && !in_array(get_class($exception), $this->_skipExceptions))
            $this->_email('CLI Exception', Misc::dump($exception, $message, true));

        // continue with exception handle logic
        parent::handleException($exception);
    }
392457
private function sendErrorResponse(ClientException $exception): \Generator
    {
        $message = $exception->getMessage();
        $status = $exception->getCode() ?: Status::BAD_REQUEST;

        /** @var \Amp\Http\Server\Response $response */
        $response = yield $this->errorHandler->handleError($status, $message);

        $response->setHeader("connection", "close");

        yield from $this->send($response);
    }