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;
    }