Saves error message to message on execution failure

@param Message $message
@param \Exception $e
@return void
425476
public function log(Message $message, \Exception $e)
    {
        $sql = "UPDATE " . $this->messageTable . "
                SET log = :log
                WHERE message_id = :id
        ";
        $stmt = $this->getDb()->prepare($sql);
        $stmt->bindValue(':log', $e->getMessage(), \PDO::PARAM_STR);
        $stmt->bindValue(':id', $message->message_id, \PDO::PARAM_INT);
        $stmt->execute();
    }
1227028
public function fail(\Exception $e)
    {
        $this->stopped();

        $this->setStatus(Job::STATUS_FAILED, $e);

        // For the failed jobs we store a lot more data for debugging
        $packet = $this->getPacket();
        $failed_payload = array_merge(json_decode($this->payload, true), array(
            'worker'    => $packet['worker'],
            'started'   => $packet['started'],
            'finished'  => $packet['finished'],
            'output'    => $packet['output'],
            'exception' => (array)json_decode($packet['exception'], true),
        ));
        $this->redis->zadd(Queue::redisKey($this->queue, 'failed'), time(), json_encode($failed_payload));
        Stats::incr('failed', 1);
        Stats::incr('failed', 1, Queue::redisKey($this->queue, 'stats'));

        Event::fire(Event::JOB_FAILURE, array($this, $e));
    }
340649
public function handleException($e)
    {
        if (!$e instanceof Exception) { // Since PHP 7, in addition to an Exception, an internal Error may occur.
            // Convert the Error to ErrorException
            $e = new ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine()); // @codeCoverageIgnore
        } // @codeCoverageIgnore

        $this->getExceptionHandler()->handle($e);
    }
522866
public function handleError(\Exception $e, $conn) {
        $this->app->onError($conn->decor, $e);
    }
575023
public function set_error($message, $halt = false)
    {
        if ($message instanceof Exception) {
            $message = $message->getMessage();
        }

        $this->_errors[] = $message;
        log_message('error', $message);

        if ($halt) {
            show_error($message);
        }
    }
966526
protected function _handleProcessException(Exception $e)
    {
        if ($e instanceof Kwf_Exception_Client) {
            $this->_errors[] = array(
                'message' => $e->getMessage()
            );
        } else {
            if (!$e instanceof Kwf_Exception) $e = new Kwf_Exception_Other($e);
            $e->logOrThrow();
            $this->_errors[] = array(
                'message' => trlKwf('An error occured while processing the form. Please try to submit again later.')
            );
        }
    }
202315
private function handleExternalError(\Exception $e) {
        $reflection = new \ReflectionClass($e);
        echo '<header>';
            echo '<h1>Exception: ' . $reflection->getName() . '</h1>';
            echo '<h2>Message: ' . $e->getMessage() . '</h2>';
            echo '<h3>' . $e->getFile() . ':' . $e->getLine() . '</h3>';
        echo '</header>';
        if ( method_exists($e, 'getContext') ) {
            echo 'Debug:';
            !d( $e->getContext() );
        }
    }
1085506
public function send(Message $message) : void
    {
        if ($this->destination === null) {
            $destination = $message->getDestination();
            if ($destination === null) {
                throw new \Exception('Cannot send message, no destination set.');
            }
        } else {
            $destination = $this->destination;
        }
        $relayState = $message->getRelayState();

        $msgStr = $message->toSignedXML();

        Utils::getContainer()->debugMessage($msgStr, 'out');
        $msgStr = $msgStr->ownerDocument->saveXML($msgStr);

        $msgStr = base64_encode($msgStr);

        if ($message instanceof Request) {
            $msgType = 'SAMLRequest';
        } else {
            $msgType = 'SAMLResponse';
        }

        $post = [];
        $post[$msgType] = $msgStr;

        if ($relayState !== null) {
            $post['RelayState'] = $relayState;
        }

        Utils::getContainer()->postRedirect($destination, $post);
    }
1151999
protected function reportException(Exception $e)
    {
        $handler = $this->app->make(ExceptionHandler::class);

        $handler->report($e);
    }
1181289
protected function log(
        $message, $source = null, $level = E_NOTICE, $data = null
    )
    {
        if (!($this->evtManager instanceof Manager)) {
            $e = new ExceptionExtended(sprintf(
                "%s::\$evtManager isn't instance of %s",
                get_class($this), Manager::class
            ));
            $e->setData($data);
            throw $e;
        }
        if (is_null($source)) {
            $source = ":missed:";
        }
        $args = new Args([
            'message' => $message,
            'source'  => $source,
            'level'   => (int)$level,
        ]);
        $this->evtManager->fire(':log:', $args);
    }
889952
private function _failOnErrorAction(Exception $exception = null, $message = '', $level = Project::MSG_INFO)
    {
        if ($this->_failonerror) {
            throw new BuildException(
                $exception !== null ? $exception : $message,
                $this->getLocation()
            );
        } else {
            $this->log(
                $exception !== null && $message === '' ? $exception->getMessage() : $message,
                $level
            );
        }
    }
741506
protected function logException(\Exception $e)
    {
        $this->logger->log(call_user_func($this->exceptionLogFilter, $e), sprintf('%s: %s (uncaught exception) at %s line %s', get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()), ['exception' => $e]);
    }
749347
public static function log(Exception $e)
    {
        Base::getLog()->error($e->getMessage(), [
            'code' => $e->getCode(),
            'file' => $e->getFile(),
            'line' => $e->getLine(),
        ]);
    }
945937
public void error(String msg, Throwable e) {
        doLog(msg, LOG_ERROR, null, e);
    }
940606
public function handleError(int $severity, string $message, 
        string $filename = null, int $lineno = 0, array $context = []
    ) : void
    {
        throw new \ErrorException($message, 0, $severity, $filename, $lineno);
    }
436773
public function logError(Exception $exception, $message = '')
    {
        if (empty($message)) {
            $message = $exception->getMessage();
        }

        array_push($this->store, array(
            'data' => $message,
            'file' => $exception->getFile(),
            'line' => $exception->getLine(),
            'type' => 'error'
        ));
    }
454183
public function appException($e)
    {
        throw new ErrorException($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine(), $e->getTrace());

    }