Skip to content

Commit

Permalink
fix: error cli
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgfr committed Mar 7, 2022
1 parent eff585b commit ecd1df4
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,23 @@ async function processUserInformations() {
console.log('Missing informations 😭');
return;
}
const kLines = await getKline(pair, interval, startDate, endDate);
saveKline(
fileName +
`${pair}_${interval}_${formatDate(startDate)}_${formatDate(
endDate,
)}.json`,
kLines,
const kLines = await getKline(pair, interval, startDate, endDate).catch(
() => {
console.log(
'Error with binance-api, we cannot get klines for this period or pair 😅',
);
},
);
console.log('Done 🎉');
if (kLines) {
saveKline(
fileName +
`${pair}_${interval}_${formatDate(startDate)}_${formatDate(
endDate,
)}.json`,
kLines,
);
console.log('Done 🎉');
}
}

export async function runCommand() {
Expand Down

0 comments on commit ecd1df4

Please sign in to comment.