refactor: throw errors directly in async functions (#39233)
This commit is contained in:
parent
68701c4c3c
commit
724f90a2a7
3 changed files with 19 additions and 20 deletions
|
@ -46,7 +46,7 @@ export function log (message: string): void {
|
|||
|
||||
// remove a function with no replacement
|
||||
export function removeFunction<T extends Function> (fn: T, removedName: string): T {
|
||||
if (!fn) { throw Error(`'${removedName} function' is invalid or does not exist.`); }
|
||||
if (!fn) { throw new Error(`'${removedName} function' is invalid or does not exist.`); }
|
||||
|
||||
// wrap the deprecated function to warn user
|
||||
const warn = warnOnce(`${fn.name} function`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue