From ed3a3726e19591a30d3243dc221de8dd36c3d6c5 Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 11 Dec 2019 10:51:04 -0400 Subject: [PATCH] Don't call onError() for python CancelledError --- src/qml/Pages/AddAccount/SignIn.qml | 2 -- src/qml/event_handlers.js | 8 ++++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/qml/Pages/AddAccount/SignIn.qml b/src/qml/Pages/AddAccount/SignIn.qml index ca1b12c5..2815772e 100644 --- a/src/qml/Pages/AddAccount/SignIn.qml +++ b/src/qml/Pages/AddAccount/SignIn.qml @@ -50,8 +50,6 @@ HBox { ) }, type => { - if (type === "CancelledError") return - loginFuture = null signInTimeout.stop() diff --git a/src/qml/event_handlers.js b/src/qml/event_handlers.js index 4392a711..58c9029c 100644 --- a/src/qml/event_handlers.js +++ b/src/qml/event_handlers.js @@ -21,9 +21,13 @@ function onCoroutineDone(uuid, result, error, traceback) { let type = py.getattr(py.getattr(error, "__class__"), "__name__") let args = py.getattr(error, "args") + type === "CancelledError" ? + console.warn(`python: cancelled: ${uuid}`) : + onError ? - onError(type, args, error, traceback) : - console.error(`python: ${uuid}\n${traceback}`) + onError(type, args, error, traceback) : + + console.error(`python: ${uuid}\n${traceback}`) } else if (onSuccess) { onSuccess(result) }