Skip to content

Commit

Permalink
fix(jira): show better error message when Jira returns a 401
Browse files Browse the repository at this point in the history
Fixes #79
  • Loading branch information
tagoro9 committed Sep 22, 2020
1 parent dd377cb commit 06e259c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/issue-tracker/jira/Jira.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,14 @@ export class Jira implements Tracker {
private mapError(error: NodeJS.ErrnoException | HttpError): Observable<never> {
if ('status' in error) {
const code = error.status;
if (code === 401) {
return throwError(
new JiraErrorImpl(
'Could not authenticate with Jira. Double check that your credentials are correct',
code,
),
);
}
const message =
(error.body.errorMessages && error.body.errorMessages[0]) ||
'Something went wrong when connecting with jira';
Expand Down

0 comments on commit 06e259c

Please sign in to comment.