refactor: throw errors directly in async functions (#39233)

This commit is contained in:
Milan Burda 2023-07-31 10:39:37 +02:00 committed by GitHub
parent 68701c4c3c
commit 724f90a2a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 20 deletions

View file

@ -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`);