diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-01-08 20:09:30 -0600 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-01-08 20:09:30 -0600 |
commit | 5263c303e19f3ac35438193020fa92f8db9ada2c (patch) | |
tree | 2fb1aa1103671dca9a2f0a654728767f0b88112f | |
parent | 4c68a40bfbbb2f587847bcfe77bc6a8253294723 (diff) | |
parent | d457892a61a2dc45e9a9f68ffae7949b4976bd52 (diff) | |
download | phosphor-rest-server-5263c303e19f3ac35438193020fa92f8db9ada2c.tar.gz phosphor-rest-server-5263c303e19f3ac35438193020fa92f8db9ada2c.zip |
Merge pull request #11 from bradbishop/typeerrors
Handle type errors for method call parameters.
-rw-r--r-- | obmc-rest | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -18,6 +18,7 @@ import crypt DBUS_UNKNOWN_INTERFACE = 'org.freedesktop.UnknownInterface' DBUS_UNKNOWN_METHOD = 'org.freedesktop.DBus.Error.UnknownMethod' DBUS_INVALID_ARGS = 'org.freedesktop.DBus.Error.InvalidArgs' +DBUS_TYPE_ERROR = 'org.freedesktop.DBus.Python.TypeError' DELETE_IFACE = 'org.openbmc.Object.Delete' _4034_msg = "The specified %s cannot be %s: '%s'" @@ -243,6 +244,8 @@ class MethodHandler(RouteHandler): except dbus.exceptions.DBusException, e: if e.get_dbus_name() == DBUS_INVALID_ARGS: abort(400, str(e)) + if e.get_dbus_name() == DBUS_TYPE_ERROR: + abort(400, str(e)) raise @staticmethod |