refactor: error handling

Add boolean to disable throwing error for query.
Reject promises when using _async exports.
Return errors as strings instead of Error (fails to serialise).

Fixes #122
This commit is contained in:
Linden committed 2022-06-04 14:50:49 +10:00
1 parent 2e751a3537
commit 340ca48012
4 files changed
+49 -23

No files matched your search

+1 -1
View File
@@ -15,4 +15,4 @@ export type TransactionQuery = {
// working with this type is impossible but at least we can pretend to be strictly typed
export type CFXParameters = any[];
export type CFXCallback = (result: QueryResponse | number | null) => void;
export type CFXCallback = (result: QueryResponse | number | null, err?: string) => void;