Piwik\API\ResponseBuilder::decorateExceptionWithDebugTrace PHP Method

decorateExceptionWithDebugTrace() private method

private decorateExceptionWithDebugTrace ( Exceptio\Exception | Throwable $e ) : Exception
$e Exceptio\Exception | Throwable
return Exception
    private function decorateExceptionWithDebugTrace($e)
    {
        // If we are in tests, show full backtrace
        if (defined('PIWIK_PATH_TEST_TO_ROOT')) {
            if (\Piwik_ShouldPrintBackTraceWithMessage()) {
                $message = $e->getMessage() . " in \n " . $e->getFile() . ":" . $e->getLine() . " \n " . $e->getTraceAsString();
            } else {
                $message = $e->getMessage() . "\n \n --> To temporarily debug this error further, set const PIWIK_PRINT_ERROR_BACKTRACE=true; in index.php";
            }
            return new Exception($message);
        }
        return $e;
    }