fix: don't throw errors outside of promises

This commit is contained in:
Linden committed 2023-06-18 04:14:33 +10:00
1 parent c97a07a377
commit 1829ded03c
3 files changed
+20 -20

No files matched your search

+3 -3
View File
@@ -12,7 +12,7 @@ export const rawExecute = (
query: string,
parameters: CFXParameters,
cb?: CFXCallback,
throwError?: boolean,
isPromise?: boolean,
unpack?: boolean
) => {
if (typeof query !== 'string')
@@ -104,7 +104,7 @@ export const rawExecute = (
resource: invokingResource,
});
if (cb && throwError) return cb(null, error);
throw new Error(error);
if (cb && isPromise) return cb(null, error);
console.error(error);
});
};