aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWBRK-dev <[email protected]>2024-04-20 08:54:44 +0200
committerWBRK-dev <[email protected]>2024-04-20 08:54:44 +0200
commit44d6ff5a11f41db7776910a4e8fd635352913b06 (patch)
tree01c2980ab1f8bba9c7b1106b7ca15ee452a4c456
parent47e104438ae4799436105c357ef0b7213bfd8f62 (diff)
downloadaniwatch-api-44d6ff5a11f41db7776910a4e8fd635352913b06.tar.xz
aniwatch-api-44d6ff5a11f41db7776910a4e8fd635352913b06.zip
feat: added new error message
-rw-r--r--src/extractors/megacloud.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/extractors/megacloud.ts b/src/extractors/megacloud.ts
index 88b6d94..7749ad1 100644
--- a/src/extractors/megacloud.ts
+++ b/src/extractors/megacloud.ts
@@ -103,6 +103,10 @@ class MegaCloud {
}
const vars = this.extractVariables(text, "MEGACLOUD");
+ if (!vars.length) {
+ throw new Error("Can't find variables. Perhaps the extractor is outdated.");
+ }
+
const { secret, encryptedSource } = this.getSecret(
encryptedString as string,
vars