From: Michael Tremer Date: Fri, 20 Oct 2023 09:33:19 +0000 (+0000) Subject: buildservice: Pass on the error code from the API X-Git-Tag: 0.9.30~1428 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=605615a24fb10fe77b231f498b481d529d60c9db;p=pakfire.git buildservice: Pass on the error code from the API Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/buildservice.c b/src/libpakfire/buildservice.c index 4a6aa60c1..859f3da70 100644 --- a/src/libpakfire/buildservice.c +++ b/src/libpakfire/buildservice.c @@ -238,18 +238,10 @@ static int pakfire_buildservice_handle_error(struct pakfire_buildservice* servic m = json_object_get_string(message); // Log the error - CTX_ERROR(service->ctx, "%s responded with error %u:\n %s\n", url, c, m); + CTX_ERROR(service->ctx, "%s responded with error %u (%s):\n %s\n", + url, c, strerror(c), m); - // Translate the codes - switch (c) { - case 400: - return -EINVAL; - - default: - break; - } - - return 1; + return -c; } /*