18719: handle updates on flush()
[arvados.git] / sdk / python / arvados / errors.py
index c9eda2d1c9c6eb306daedba17fc63c3ec89348d2..4fe1f76543a356f1c36aafea23efbc5895088c87 100644 (file)
@@ -1,3 +1,7 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
 # errors.py - Arvados-specific exceptions.
 
 import json
@@ -8,7 +12,7 @@ from collections import OrderedDict
 class ApiError(apiclient_errors.HttpError):
     def _get_reason(self):
         try:
-            return '; '.join(json.loads(self.content)['errors'])
+            return '; '.join(json.loads(self.content.decode('utf-8'))['errors'])
         except (KeyError, TypeError, ValueError):
             return super(ApiError, self)._get_reason()