Permalink
Browse files

Different error message formats

  • Loading branch information...
1 parent 46ce762 commit 4c11672f095031a6f284d5333ba0081eca5de424 @beberlei beberlei committed Jun 18, 2012
Showing with 13 additions and 3 deletions.
  1. +13 −3 lib/Doctrine/KeyValueStore/Storage/WindowsAzureTableStorage.php
@@ -164,10 +164,20 @@ private function convertResponseToException($response)
$dom = new \DomDocument('1.0', 'UTF-8');
$dom->loadXML($response->getBody());
- throw new HttpStorageException(
- $dom->getElementsByTagName('Message')->item(0)->nodeValue
- );
+ $message = "";
+ $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)

0 comments on commit 4c11672

Please sign in to comment.