Adding wrong credentials error message

This commit is contained in:
Fabian Stamm 2018-06-10 21:02:27 +02:00
parent bbf9b0c008
commit 709c4646ca
2 changed files with 3 additions and 0 deletions

View File

@ -85,6 +85,8 @@ var SecureFile = /** @class */ (function () {
//TODO probably better fail check
throw new NoConnection();
case 4:
if (code_res.status == 403)
throw new Error("Unauthorized");
statusParser(code_res);
return [4 /*yield*/, code_res.json()];
case 5:

View File

@ -47,6 +47,7 @@ export default class SecureFile {
//TODO probably better fail check
throw new NoConnection();
}
if (code_res.status == 403) throw new Error("Unauthorized");
statusParser(code_res);
let code = (await code_res.json()).code;
let r = new rsa(this.PrivateKey, "pkcs1-pem");