private function convertException($rawException = null)
    {
        if (null === $rawException || $rawException instanceof ClientAware) {
            return $rawException;
        }

        $errorClass = $this->findErrorClass($rawException);
        if (null !== $errorClass) {
            return new $errorClass($rawException->getMessage(), $rawException->getCode(), $rawException);
        }

        return $rawException;
    }
private function convertException($rawException = null)
    {
        if (null === $rawException || $rawException instanceof ClientAware) {
            return $rawException;
        }

        $errorClass = $this->findErrorClass($rawException);
        if (null !== $errorClass) {
            return new $errorClass($rawException->getMessage(), $rawException->getCode(), $rawException);
        }

        return $rawException;
    }
private function convertException ( $ rawException = null ) { if ( null === $ rawException || $ rawException instanceof ClientAware ) { return $ rawException ; } $ errorClass = $ this -> findErrorClass ( $ rawException ) ; if ( null !== $ errorClass ) { return new $ errorClass ( $ rawException -> getMessage ( ) , $ rawException -> getCode ( ) , $ rawException ) ; } return $ rawException ; }
Tries to convert a raw exception into a user warning or error
that is displayed to the user.

@param \Exception|\Error $rawException

@return \Exception|\Error
Tries to convert a raw exception into a user warning or error that is displayed to the user .