private function getExceptionData($exception, $full = false, $plainText = false)
    {
        if ($plainText) {
            $text = $exception->getMessage() . "\n";
            if ($full) {
                $text .= $exception->getFile() . " #" . $exception->getLine() . "\n";
                $text .= $exception->getTraceAsString() . "\n";
            }
            return $text;
        } else {
            $data = [
                'name' => $this->getExceptionName($exception),
                'message' => $exception->getMessage(),
                'code' => $exception->getCode(),
            ];
            if ($full) {
                $data = ArrayHelper::merge($data, [
                    'file' => $exception->getFile(),
                    'line' => $exception->getLine(),
                    'stacktrace' => $exception->getTrace(),
                ]);
            }
            return $data;
        }
    }