Adding wrong credentials error message
This commit is contained in:
parent
bbf9b0c008
commit
709c4646ca
2
index.js
2
index.js
@ -85,6 +85,8 @@ var SecureFile = /** @class */ (function () {
|
|||||||
//TODO probably better fail check
|
//TODO probably better fail check
|
||||||
throw new NoConnection();
|
throw new NoConnection();
|
||||||
case 4:
|
case 4:
|
||||||
|
if (code_res.status == 403)
|
||||||
|
throw new Error("Unauthorized");
|
||||||
statusParser(code_res);
|
statusParser(code_res);
|
||||||
return [4 /*yield*/, code_res.json()];
|
return [4 /*yield*/, code_res.json()];
|
||||||
case 5:
|
case 5:
|
||||||
|
1
index.ts
1
index.ts
@ -47,6 +47,7 @@ export default class SecureFile {
|
|||||||
//TODO probably better fail check
|
//TODO probably better fail check
|
||||||
throw new NoConnection();
|
throw new NoConnection();
|
||||||
}
|
}
|
||||||
|
if (code_res.status == 403) throw new Error("Unauthorized");
|
||||||
statusParser(code_res);
|
statusParser(code_res);
|
||||||
let code = (await code_res.json()).code;
|
let code = (await code_res.json()).code;
|
||||||
let r = new rsa(this.PrivateKey, "pkcs1-pem");
|
let r = new rsa(this.PrivateKey, "pkcs1-pem");
|
||||||
|
Reference in New Issue
Block a user