From e0cef17c0c48b9fcba9e020aae07d6f85674074b Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 7 Nov 2019 10:11:45 +0100 Subject: [PATCH] tokens: Allow authenticators to send an error message --- common/flatpak-transaction.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/flatpak-transaction.c b/common/flatpak-transaction.c index abf1178b..39985487 100644 --- a/common/flatpak-transaction.c +++ b/common/flatpak-transaction.c @@ -2834,7 +2834,13 @@ request_tokens_for_remote (FlatpakTransaction *self, } if (data.response != FLATPAK_AUTH_RESPONSE_OK) - return flatpak_fail (error, "Failed to get tokens for ref"); + { + const char *error_message = NULL; + if (g_variant_lookup (results, "error-message", "&s", &error_message)) + return flatpak_fail (error, "Failed to get tokens for ref: %s", error_message); + else + return flatpak_fail (error, "Failed to get tokens for ref"); + } tokens = g_variant_lookup_value (results, "tokens", G_VARIANT_TYPE ("a{sas}")); if (tokens == NULL)