Skip to content

Commit

Permalink
fix: correct cli error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
ernest-okot committed Mar 10, 2019
1 parent e1214ea commit 1d03888
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env node

import { AxiosError } from "axios";
import program from "commander";

import * as momo from "./";
import { Credentials } from "./common";
import { MtnMoMoError } from "./errors";

const { version } = require("../package.json");

Expand Down Expand Up @@ -34,12 +34,6 @@ users
);
});
})
.catch((error: AxiosError) => {
let message: string = stringify(error.message);

if (error.response && error.response.data) {
message = stringify(error.response.data);
}

console.log(message);
.catch((error: MtnMoMoError) => {
console.log(error);
});

0 comments on commit 1d03888

Please sign in to comment.