From 7168f76614589342be95e925ba6174b0ed1f4955 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 22 Mar 2019 20:19:08 -0600 Subject: [PATCH] Emit sync errors for capturing by clients For https://github.com/vector-im/riot-web/issues/9260 --- src/sync.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sync.js b/src/sync.js index f4ea0bf8840..337f4100ce3 100644 --- a/src/sync.js +++ b/src/sync.js @@ -724,6 +724,9 @@ SyncApi.prototype._sync = async function(syncOptions) { // log the exception with stack if we have it, else fall back // to the plain description console.error("Caught /sync error", e.stack || e); + + // Emit the exception for client handling + this.client.emit("sync.unexpectedError", e); } // update this as it may have changed