Skip to content

Commit

Permalink
Improve pull error message
Browse files Browse the repository at this point in the history
  • Loading branch information
aleks-tpom6oh committed Nov 15, 2024
1 parent 45d034d commit c8b23b3
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,17 @@ function _request(options) {
return resolve(JSON.parse(response.body));
})
.catch((err) => {
report.error(`${responseToError(err.response, err)}\n`);
reject(
new AvoError(`Server Error. ${err.message}`, {
original: err,
exit: 2,
}),
);
let responseError = responseToError(err.response, err);
if (responseError != null) {
reject(responseError);
} else {
reject(
new AvoError(`Server Error. ${err.message}`, {
original: err,
exit: 2,
}),
);
}
});
});
}
Expand Down

0 comments on commit c8b23b3

Please sign in to comment.