diff --git a/src/API.ts b/src/API.ts index 6e4a69d..6d5bfa1 100644 --- a/src/API.ts +++ b/src/API.ts @@ -718,13 +718,13 @@ export class UserAPI { input: string | Generator, options: InputOptions = {}, id: number | string = "", - ): Player|undefined => { + ): Player => { const zid = "z" + id.toString(); const key = id === "" ? this.generateCacheKey(input, options) : zid; const validSyntax = typeof input === "string" && !this.invalidPatterns[input] if(!validSyntax) this.app.api.log(`Invalid syntax: ${input}`); - + let player; let replace = false; @@ -765,7 +765,7 @@ export class UserAPI { return player; } else { - return undefined; + throw new Error(`Invalid syntax: ${input}`); } };