From efb32b8e566a9a53eb80e2d9f326232946c7ed37 Mon Sep 17 00:00:00 2001
From: Timm Fitschen <timm.fitschen@ds.mpg.de>
Date: Tue, 4 Dec 2018 16:48:58 +0100
Subject: [PATCH] BUG: parsing server error with userInfo

---
 src/caosdb/exceptions.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/caosdb/exceptions.py b/src/caosdb/exceptions.py
index a5d6e996..45c4570b 100644
--- a/src/caosdb/exceptions.py
+++ b/src/caosdb/exceptions.py
@@ -70,9 +70,10 @@ class ClientErrorException(CaosDBException):
 class ServerErrorException(CaosDBException):
     def __init__(self, body):
         xml = etree.fromstring(body)
-        msg = xml[0].get("description")
-        if xml[0].text is not None:
-            msg = msg + "\n\n" + xml[0].text
+        error = xml.xpath('/Response/Error')[0]
+        msg = error.get("description")
+        if error.text is not None:
+            msg = msg + "\n\n" + error.text
         CaosDBException.__init__(self, msg)
 
 
-- 
GitLab