Skip to content

Commit 6aca96f

Browse files
authored
Improve error for incorrect credentials (#114)
1 parent a228c13 commit 6aca96f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/hame_api.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ export class HameApi {
187187

188188
const data = (await resp.json()) as HameApiResponse;
189189

190+
if (data.code === "4") {
191+
throw new Error(
192+
`Incorrect password for ${mailbox}. Please double-check the credentials configured for the add-on and try again. (${data.code} - ${data.msg})`,
193+
);
194+
}
195+
190196
if (data.code !== "2" || !data.token) {
191197
throw new Error(
192198
`Unexpected API response code: ${data.code} - ${data.msg}`,

0 commit comments

Comments
 (0)