Gaufrette\Adapter\AzureBlobStorage::getErrorCodeFromServiceException PHP Method

getErrorCodeFromServiceException() protected method

Extracts the error code from a service exception.
protected getErrorCodeFromServiceException ( MicrosoftAzure\Storage\Common\ServiceException $exception ) : string
$exception MicrosoftAzure\Storage\Common\ServiceException
return string
    protected function getErrorCodeFromServiceException(ServiceException $exception)
    {
        $xml = @simplexml_load_string($exception->getErrorReason());
        if ($xml && isset($xml->Code)) {
            return (string) $xml->Code;
        }
        return $exception->getErrorReason();
    }