diff --git a/src/onedrive.d b/src/onedrive.d index 505cec39..29d22e69 100644 --- a/src/onedrive.d +++ b/src/onedrive.d @@ -726,6 +726,9 @@ final class OneDriveApi } } catch (OneDriveException e) { if (e.httpStatusCode == 400 || e.httpStatusCode == 401) { + // flag error and notify + log.errorAndNotify("\nERROR: Refresh token invalid, use --logout to authorize the client again.\n"); + // set error message e.msg ~= "\nRefresh token invalid, use --logout to authorize the client again"; } } diff --git a/src/sync.d b/src/sync.d index 91f252fe..82d0594e 100644 --- a/src/sync.d +++ b/src/sync.d @@ -305,7 +305,7 @@ final class SyncEngine if (e.httpStatusCode == 401) { // HTTP request returned status code 401 (Unauthorized) displayOneDriveErrorMessage(e.msg); - log.error("\nERROR: Check your configuration as your refresh_token may be empty or invalid. You may need to issue a --logout and re-authorise this client.\n"); + log.errorAndNotify("\nERROR: Check your configuration as your refresh_token may be empty or invalid. You may need to issue a --logout and re-authorise this client.\n"); // Must exit here exit(-1); } @@ -344,7 +344,7 @@ final class SyncEngine if (e.httpStatusCode == 401) { // HTTP request returned status code 401 (Unauthorized) displayOneDriveErrorMessage(e.msg); - log.error("\nERROR: Check your configuration as your refresh_token may be empty or invalid. You may need to issue a --logout and re-authorise this client.\n"); + log.errorAndNotify("\nERROR: Check your configuration as your refresh_token may be empty or invalid. You may need to issue a --logout and re-authorise this client.\n"); // Must exit here exit(-1); }