Add better error handling for zifferjs
This commit is contained in:
@ -718,7 +718,7 @@ export class UserAPI {
|
|||||||
input: string | Generator<number>,
|
input: string | Generator<number>,
|
||||||
options: InputOptions = {},
|
options: InputOptions = {},
|
||||||
id: number | string = "",
|
id: number | string = "",
|
||||||
): Player|undefined => {
|
): Player => {
|
||||||
const zid = "z" + id.toString();
|
const zid = "z" + id.toString();
|
||||||
const key = id === "" ? this.generateCacheKey(input, options) : zid;
|
const key = id === "" ? this.generateCacheKey(input, options) : zid;
|
||||||
|
|
||||||
@ -765,7 +765,7 @@ export class UserAPI {
|
|||||||
|
|
||||||
return player;
|
return player;
|
||||||
} else {
|
} else {
|
||||||
return undefined;
|
throw new Error(`Invalid syntax: ${input}`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user