From 4b68976dfb7722c2161f8492b29431e1ee73c51c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Fri, 14 Sep 2018 15:43:29 +0200 Subject: [PATCH] hide regex error behind debug flag --- src/Linkifier.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Linkifier.ts b/src/Linkifier.ts index 88c848b8..001247fc 100644 --- a/src/Linkifier.ts +++ b/src/Linkifier.ts @@ -186,7 +186,11 @@ export class Linkifier extends EventEmitter implements ILinkifier { if (!uri) { // something matched but does not comply with the given matchIndex // since this is most likely a bug the regex itself we simply do nothing here - // TODO: should this be logged for debugging? + // DEBUG: print match and throw + if ((this._terminal).debug) { + console.log({match, matcher}); + throw new Error('match found without corresponding matchIndex'); + } break; }