On Fri, Nov 06, 2015 at 04:59:58PM +0100, Sumit Bose wrote:
> @@ -658,11 +678,7 @@ static void get_subdomains_callback(struct
be_req *req,
> */
> err_maj = dp_err_type;
> err_min = errnum;
> - if (errstr) {
> - err_msg = errstr;
> - } else {
> - err_msg = dp_err_to_string(dp_err_type);
> - }
> + err_msg = safe_be_req_err_msg(errstr, dp_err_type);
Wouldn't it be even more safe to do this check in
sbus_request_return_and_finish() and not rely on the callers?
Something like the attached patch? I think we should check in
sbus_request_return_and_finish() in addition to checking in the callers,
not instead, because the string in the callback is just a diagnostics
message and we can recover by using some fallback.
If we get all the way to sbus_request_return_and_finish(), then failing
gracefully is better then abort() that libdbus calls, but it's even better
to finish the request with wrong error message then fail completely.
(I also still dislike that libdbus aborts...)