Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Commit

Permalink
fix: fixes error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisnoo committed Sep 14, 2021
1 parent c9825f7 commit 3eddc03
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/index.ts
Expand Up @@ -66,7 +66,7 @@ class ActualImportCsv extends Command {
if (!fileExists(file)) {
this.error(`File "${file}" cannot be found.`);
}
} catch (err) {
} catch (err: any) {
this.error(err);
}
}
Expand Down Expand Up @@ -107,9 +107,9 @@ class ActualImportCsv extends Command {
try {
await checkIfBudgetExists(response.budgetId);
userConfig.set('budgetId', response.budgetId);
} catch (e) {
} catch (err: any) {
this.exit();
this.error(e);
this.error(err);
}
}

Expand Down Expand Up @@ -147,8 +147,10 @@ class ActualImportCsv extends Command {
userConfig.get('accountId'),
transactions
);
} catch (e) {
this.error(e.message);
} catch (err) {
if (err instanceof Error) {
this.error(err.message);
}
}
cli.action.stop();
}
Expand Down

0 comments on commit 3eddc03

Please sign in to comment.