Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
Different error message formats
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Jun 18, 2012
1 parent 46ce762 commit 4c11672
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/Doctrine/KeyValueStore/Storage/WindowsAzureTableStorage.php
Expand Up @@ -164,10 +164,20 @@ private function convertResponseToException($response)
$dom = new \DomDocument('1.0', 'UTF-8'); $dom = new \DomDocument('1.0', 'UTF-8');
$dom->loadXML($response->getBody()); $dom->loadXML($response->getBody());


throw new HttpStorageException( $message = "";
$dom->getElementsByTagName('Message')->item(0)->nodeValue $nodeList = $dom->getElementsByTagName('Message');
); if ($nodeList->length > 0) {
$message = $nodeList->item(0)->nodeValue;
throw new HttpStorageException($message);
}

$nodeList = $dom->getElementsByTagName('message');
if ($nodeList->length > 0) {
$message = $nodeList->item(0)->nodeValue;
throw new HttpStorageException($message);
}


throw new HttpStorageException($response->getBody());
} }


public function createTable($tableName) public function createTable($tableName)
Expand Down

0 comments on commit 4c11672

Please sign in to comment.