From 5043ef3c7d193adf103f356dbb0eeafbef0bc8c9 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Wed, 4 Dec 2019 17:00:01 +0100 Subject: [PATCH] device: Print warnings for fatal errors --- src/device.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/device.c b/src/device.c index e5f5c4c..7399505 100644 --- a/src/device.c +++ b/src/device.c @@ -757,6 +757,9 @@ static void verify_cb(FpDevice *dev, GAsyncResult *res, void *user_data) g_clear_object (&priv->verify_data); g_signal_emit(rdev, signals[SIGNAL_VERIFY_STATUS], 0, name, TRUE); + if (error && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + g_warning ("Device reported an error during verify: %s", error->message); + /* Return the cancellation or reset action right away if vanished. */ if (priv->current_cancel_context) { dbus_g_method_return(priv->current_cancel_context); @@ -800,6 +803,9 @@ static void identify_cb(FpDevice *dev, GAsyncResult *res, void *user_data) g_clear_pointer (&priv->identify_data, g_ptr_array_unref); g_signal_emit (rdev, signals[SIGNAL_VERIFY_STATUS], 0, name, TRUE); + if (error && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + g_warning ("Device reported an error during identify: %s", error->message); + /* Return the cancellation or reset action right away if vanished. */ if (priv->current_cancel_context) { dbus_g_method_return(priv->current_cancel_context); @@ -1103,6 +1109,9 @@ static void enroll_cb(FpDevice *dev, GAsyncResult *res, void *user_data) g_signal_emit(rdev, signals[SIGNAL_ENROLL_STATUS], 0, name, TRUE); + if (error && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + g_warning ("Device reported an error during enroll: %s", error->message); + /* Return the cancellation or reset action right away if vanished. */ if (priv->current_cancel_context) { dbus_g_method_return(priv->current_cancel_context);