From 771521a885992795ee9a5ee5707dfe89907c0df3 Mon Sep 17 00:00:00 2001
From: "Kai A. Hiller" <V02460@gmail.com>
Date: Wed, 7 Aug 2019 11:44:07 -0400
Subject: [PATCH] Make throwing EventUnknownError pretty

Signed-off-by: Kai A. Hiller <V02460@gmail.com>
---
 src/matrixeventprocessor.ts | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/matrixeventprocessor.ts b/src/matrixeventprocessor.ts
index de7f91e..025d353 100644
--- a/src/matrixeventprocessor.ts
+++ b/src/matrixeventprocessor.ts
@@ -139,14 +139,12 @@ export class MatrixEventProcessor {
         } else if (event.type === "m.room.encryption" && context.rooms.remote) {
             try {
                 await this.HandleEncryptionWarning(event.room_id);
-                return;
             } catch (err) {
                 throw wrapError(err, Unstable.EventNotHandledError, `Failed to handle encrypted room, ${err}`);
             }
-        } else {
-            throw new Unstable.EventUnknownError("Got non m.room.message event");
+            return;
         }
-        throw new Unstable.EventUnknownError(); // Shouldn't be reachable
+        throw new Unstable.EventUnknownError(`${event.event_id} not processed by bridge`);
     }
 
     public async HandleEncryptionWarning(roomId: string): Promise<void> {
-- 
GitLab