From bf0bd620f1f9dae479ebfe9fababce03b1ea2368 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Fri, 20 Dec 2019 15:54:39 +0000 Subject: [PATCH] Tidied up Case Insensitive Regex ops --- src/core/operations/ToCaseInsensitiveRegex.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/operations/ToCaseInsensitiveRegex.mjs b/src/core/operations/ToCaseInsensitiveRegex.mjs index 58b21ef5..77b14172 100644 --- a/src/core/operations/ToCaseInsensitiveRegex.mjs +++ b/src/core/operations/ToCaseInsensitiveRegex.mjs @@ -1,10 +1,12 @@ /** * @author masq [github.cyberchef@masq.cc] + * @author n1073645 * @copyright Crown Copyright 2018 * @license Apache-2.0 */ import Operation from "../Operation.mjs"; +import OperationError from "../errors/OperationError.mjs"; /** * To Case Insensitive Regex operation @@ -54,7 +56,7 @@ class ToCaseInsensitiveRegex extends Operation { try { RegExp(input); } catch (error) { - return "Invalid Regular Expression (Please note this version of node does not support look behinds)."; + throw new OperationError("Invalid Regular Expression (Please note this version of node does not support look behinds)."); } // Example: [test] -> [[tT][eE][sS][tT]]