Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit d797650

Browse files
committed
Remove unnecessary promise rejects.
1 parent 3bcfdf4 commit d797650

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/action/log.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,11 @@ export function getLogPath(network) {
6666

6767
/**
6868
* Retrieves the entire LND log file as a string.
69-
* @return {Promise}
69+
* @return {Promise<string>}
7070
*/
71-
export function getLogs() {
71+
export async function getLogs() {
7272
if (!_FS) {
73-
return Promise.reject(
74-
new Error('Cannot get logs with no FS in action/log.js')
75-
);
73+
throw new Error('Cannot get logs with no FS in action/log.js');
7674
}
7775
return _FS.readFile(getLogPath(_store.network), 'utf8');
7876
}
@@ -83,9 +81,7 @@ export function getLogs() {
8381
*/
8482
export async function shareLogs() {
8583
if (!_Share) {
86-
return Promise.reject(
87-
new Error('Cannot share logs with no Share in action/log.js')
88-
);
84+
throw new Error('Cannot share logs with no Share in action/log.js');
8985
}
9086
const logs = await getLogs();
9187
return _Share.share({

0 commit comments

Comments
 (0)