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;
        }
    }
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;
        }
    }
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 ; } }
Get exception data as string or array
@param \Throwable $exception
@param bool       $full
@param bool       $plainText
@return array|string
Get exception data as string or array