python3 ValueError object has no attribute message
Change-Id: I09862b245774ab4b26f2ea11dfe4d0cc1d4305b7
This commit is contained in:
parent
04bfb5778b
commit
e6dc1f0819
|
@ -12,6 +12,8 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_messaging.rpc import client
|
from oslo_messaging.rpc import client
|
||||||
from webob import exc
|
from webob import exc
|
||||||
|
@ -68,8 +70,9 @@ class Controller(object):
|
||||||
raise exc.HTTPServiceUnavailable(e.value)
|
raise exc.HTTPServiceUnavailable(e.value)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
LOG.error('Exception during call of the method {method_name}: '
|
LOG.error('Exception during call of the method {method_name}: '
|
||||||
'{exc}'.format(method_name=method_name, exc=str(e)))
|
'{exc}'.format(method_name=method_name,
|
||||||
raise exc.HTTPBadRequest(e.message)
|
exc=six.text_type(e)))
|
||||||
|
raise exc.HTTPBadRequest(six.text_type(e))
|
||||||
|
|
||||||
|
|
||||||
def create_resource():
|
def create_resource():
|
||||||
|
|
Loading…
Reference in New Issue