Browse Source

python3 ValueError object has no attribute message

Change-Id: I09862b245774ab4b26f2ea11dfe4d0cc1d4305b7
zhurong 4 months ago
parent
commit
e6dc1f0819
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      murano/api/v1/static_actions.py

+ 5
- 2
murano/api/v1/static_actions.py View File

@@ -12,6 +12,8 @@
12 12
 #    License for the specific language governing permissions and limitations
13 13
 #    under the License.
14 14
 
15
+import six
16
+
15 17
 from oslo_log import log as logging
16 18
 from oslo_messaging.rpc import client
17 19
 from webob import exc
@@ -68,8 +70,9 @@ class Controller(object):
68 70
             raise exc.HTTPServiceUnavailable(e.value)
69 71
         except ValueError as e:
70 72
             LOG.error('Exception during call of the method {method_name}: '
71
-                      '{exc}'.format(method_name=method_name, exc=str(e)))
72
-            raise exc.HTTPBadRequest(e.message)
73
+                      '{exc}'.format(method_name=method_name,
74
+                                     exc=six.text_type(e)))
75
+            raise exc.HTTPBadRequest(six.text_type(e))
73 76
 
74 77
 
75 78
 def create_resource():

Loading…
Cancel
Save