core: use NM_UTILS_ERROR_CANCELLED_DISPOSING error reason

This commit is contained in:
Thomas Haller
2015-09-24 13:14:14 +02:00
parent 44f3f18797
commit 320f454e9f
5 changed files with 17 additions and 52 deletions

View File

@@ -216,18 +216,7 @@ _do_cancel_secrets (NMActRequest *self, GetSecretsInfo *info, gboolean is_dispos
if (info->callback) {
gs_free_error GError *error = NULL;
if (is_disposing) {
/* Use a different error code. G_IO_ERROR_CANCELLED is only used synchronously
* when the user calls nm_act_request_cancel_secrets(). Disposing the instance
* with pending requests also cancels the requests, but with a different error
* code. */
g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Disposing NMActRequest instance");
} else {
g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_CANCELLED,
"Request cancelled");
}
nm_utils_error_set_cancelled (&error, is_disposing, "NMActRequest");
info->callback (self, info, NULL, error, info->callback_data);
}