From 473c97008990d23380b593221aeda6477ac3ba1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 16:01:04 +0200 Subject: [PATCH] #1270: improve error handling --- lib/util/replaceContentBlockReference.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/util/replaceContentBlockReference.js b/lib/util/replaceContentBlockReference.js index 2af38da56..53a38942c 100644 --- a/lib/util/replaceContentBlockReference.js +++ b/lib/util/replaceContentBlockReference.js @@ -92,7 +92,9 @@ export default class ReplaceContentBlockReference { */ static replaceReference(str, parentName, fromList, to) { if (!str) { - return str; + const ex = new Error('No string provided'); + ex.code = 200; + throw ex; } fromList ||= Util.OPTIONS.referenceFrom; to ||= Util.OPTIONS.referenceTo;