diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2016-11-28 15:44:18 -0500 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2016-11-28 15:44:18 -0500 |
commit | fce7756c4af482aa27ed77c5ef4b93d7d687d1f7 (patch) | |
tree | 27c441f3caca9adddff5f0563696653658fc985b /module/obmc/wsgi/apps | |
parent | 8b0d3fa629443b5a8fe5a2204dfa9c199fa3ae36 (diff) | |
download | phosphor-rest-server-fce7756c4af482aa27ed77c5ef4b93d7d687d1f7.tar.gz phosphor-rest-server-fce7756c4af482aa27ed77c5ef4b93d7d687d1f7.zip |
Return HTTP 503 when mapper is busy
Suppress traceback and provide an informative error message
when the mapper cannot respond to a query.
Resolves openbmc/openbmc#812
Change-Id: I85d4e59c5a25dc8a19fbdb1d1cf8c2a0f4350991
Diffstat (limited to 'module/obmc/wsgi/apps')
-rw-r--r-- | module/obmc/wsgi/apps/rest_dbus.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/module/obmc/wsgi/apps/rest_dbus.py b/module/obmc/wsgi/apps/rest_dbus.py index b1da97d..93f0895 100644 --- a/module/obmc/wsgi/apps/rest_dbus.py +++ b/module/obmc/wsgi/apps/rest_dbus.py @@ -96,6 +96,9 @@ class RouteHandler(object): try: return f(**kw) except dbus.exceptions.DBusException, e: + if e.get_dbus_name() == \ + 'org.freedesktop.DBus.Error.ObjectPathInUse': + abort(503, str(e)) if e.get_dbus_name() != obmc.mapper.MAPPER_NOT_FOUND: raise if callback is None: |