Skip to content

Commit 099918a

Browse files
authored
Merge pull request #57 from lightninglabs/promise-errors
lnc: return Error object in rejected promises
2 parents 6a10308 + ae5f366 commit 099918a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/lnc.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ export default class LNC {
203203
} else if (counter > 20) {
204204
clearInterval(interval);
205205
reject(
206-
'Failed to connect the WASM client to the proxy server'
206+
new Error(
207+
'Failed to connect the WASM client to the proxy server'
208+
)
207209
);
208210
}
209211
}, 500);
@@ -231,7 +233,7 @@ export default class LNC {
231233
log.info('The WASM client is ready');
232234
} else if (counter > 20) {
233235
clearInterval(interval);
234-
reject('Failed to load the WASM client');
236+
reject(new Error('Failed to load the WASM client'));
235237
}
236238
}, 500);
237239
});

0 commit comments

Comments
 (0)