web/elements: fix TokenCopyButton error case

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-04-11 13:03:20 +02:00
parent 335c5a0b80
commit fb53dc826a
1 changed files with 3 additions and 3 deletions

View File

@ -30,9 +30,9 @@ export class TokenCopyButton extends ActionButton {
}, 1500);
});
}).catch((err: Response) => {
return err.json();
}).then(errResp => {
throw new Error(errResp["detail"]);
return err.json().then(errResp => {
throw new Error(errResp["detail"]);
});
});
}