Improve error handling in api files

Change-Id: Ib9dccf5641d72aa5d16ad3179d0df030c7664fa6
Closes-Bug: #1364018
This commit is contained in:
Sergey Kraynev 2014-09-01 09:57:12 -04:00
parent a7d10dc43b
commit 8faef30895
3 changed files with 9 additions and 3 deletions

View File

@ -20,6 +20,7 @@ import eventlet
eventlet.monkey_patch(os=False)
import os
import six
import sys
# If ../heat/__init__.py exists, add ../ to Python search path, so that
@ -61,4 +62,5 @@ if __name__ == '__main__':
systemd.notify_once()
server.wait()
except RuntimeError as e:
sys.exit("ERROR: %s" % e)
msg = six.text_type(e)
sys.exit("ERROR: %s" % msg)

View File

@ -22,6 +22,7 @@ import eventlet
eventlet.monkey_patch(os=False)
import os
import six
import sys
# If ../heat/__init__.py exists, add ../ to Python search path, so that
@ -63,4 +64,5 @@ if __name__ == '__main__':
systemd.notify_once()
server.wait()
except RuntimeError as e:
sys.exit("ERROR: %s" % e)
msg = six.text_type(e)
sys.exit("ERROR: %s" % msg)

View File

@ -22,6 +22,7 @@ import eventlet
eventlet.monkey_patch(os=False)
import os
import six
import sys
# If ../heat/__init__.py exists, add ../ to Python search path, so that
@ -63,4 +64,5 @@ if __name__ == '__main__':
systemd.notify_once()
server.wait()
except RuntimeError as e:
sys.exit("ERROR: %s" % e)
msg = six.text_type(e)
sys.exit("ERROR: %s" % msg)