summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-10-11 15:38:53 -0700
committerWilliam A. Kennington III <wak@google.com>2018-10-11 15:39:01 -0700
commitfba332baf4bdd290c3640960ac7fc0d44b1a6bd5 (patch)
tree76150b0f2ed8ee3fd2bd069b29a6b2bd88efb49a /tools
parent7a2ff91c98e97971d5a03db33c44f119302e0bc3 (diff)
downloadsdbusplus-fba332baf4bdd290c3640960ac7fc0d44b1a6bd5.tar.gz
sdbusplus-fba332baf4bdd290c3640960ac7fc0d44b1a6bd5.zip
Use return value from sd_bus_error_set*
The return value from sd_bus_error_set is always a negative error value mapping to the provided name. We should use this value instead of always returning -EINVAL. Change-Id: I102c7a0b306db873d44e9c1b7cbd9cc146ffe29c Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/sdbusplus/templates/method.mako.prototype.hpp.in6
-rw-r--r--tools/sdbusplus/templates/property.mako.prototype.hpp.in12
2 files changed, 6 insertions, 12 deletions
diff --git a/tools/sdbusplus/templates/method.mako.prototype.hpp.in b/tools/sdbusplus/templates/method.mako.prototype.hpp.in
index 35c0cb9..2053b1c 100644
--- a/tools/sdbusplus/templates/method.mako.prototype.hpp.in
+++ b/tools/sdbusplus/templates/method.mako.prototype.hpp.in
@@ -163,14 +163,12 @@ ${returns_as_tuple_index("r",pre="convertForMessage(",post=")")});
}
catch(sdbusplus::internal_exception_t& e)
{
- sd_bus_error_set(error, e.name(), e.description());
- return -EINVAL;
+ return sd_bus_error_set(error, e.name(), e.description());
}
% for e in method.errors:
catch(sdbusplus::${error_namespace(e)}::${error_name(e)}& e)
{
- sd_bus_error_set(error, e.name(), e.description());
- return -EINVAL;
+ return sd_bus_error_set(error, e.name(), e.description());
}
% endfor
diff --git a/tools/sdbusplus/templates/property.mako.prototype.hpp.in b/tools/sdbusplus/templates/property.mako.prototype.hpp.in
index b170df6..4e280f6 100644
--- a/tools/sdbusplus/templates/property.mako.prototype.hpp.in
+++ b/tools/sdbusplus/templates/property.mako.prototype.hpp.in
@@ -54,14 +54,12 @@ int ${classname}::_callback_get_${property.name}(
}
catch(sdbusplus::internal_exception_t& e)
{
- o->_intf->sd_bus_error_set(error, e.name(), e.description());
- return -EINVAL;
+ return o->_intf->sd_bus_error_set(error, e.name(), e.description());
}
% for e in property.errors:
catch(sdbusplus::${error_namespace(e)}::${error_name(e)}& e)
{
- o->_intf->sd_bus_error_set(error, e.name(), e.description());
- return -EINVAL;
+ return o->_intf->sd_bus_error_set(error, e.name(), e.description());
}
% endfor
@@ -120,14 +118,12 @@ convert${property.enum_name(interface.name)}FromString(v));
}
catch(sdbusplus::internal_exception_t& e)
{
- o->_intf->sd_bus_error_set(error, e.name(), e.description());
- return -EINVAL;
+ return o->_intf->sd_bus_error_set(error, e.name(), e.description());
}
% for e in property.errors:
catch(sdbusplus::${error_namespace(e)}::${error_name(e)}& e)
{
- o->_intf->sd_bus_error_set(error, e.name(), e.description());
- return -EINVAL;
+ return o->_intf->sd_bus_error_set(error, e.name(), e.description());
}
% endfor
OpenPOWER on IntegriCloud