Skip to content

Commit

Permalink
Merge pull request #17 from Whiterzi/main
Browse files Browse the repository at this point in the history
fix error handling when token revoked
  • Loading branch information
jimmyshiau authored Jul 11, 2024
2 parents 776005b + 0ce2b3d commit 0ef35e5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/quireService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ export async function loadProjects() {
reject(M_ERROR_NO_PROJECT);
},
onError: (error) => {
if (error.status === 401)
reject(M_ERROR_TOKEN_EXPIRED);
else
if (error.status === 400)
reject(M_ERROR_NO_PROJECT);
else
reject(M_ERROR_TOKEN_EXPIRED);
}
});
})
Expand Down Expand Up @@ -187,10 +187,10 @@ export async function createTask(task: Task, projectOid: string) {
reject("Failed to create task.");
},
onError(error) {
if (error.status === 401)
reject(M_ERROR_TOKEN_EXPIRED);
else
if (error.status === 400)
reject(error.responseJSON.message);
else
reject(M_ERROR_TOKEN_EXPIRED);
}
});
})
Expand Down

0 comments on commit 0ef35e5

Please sign in to comment.