1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-14 00:19:16 +01:00

fix: should support 409 responses as well

This commit is contained in:
Ivar Conradi Østhus 2020-09-25 21:46:52 +02:00
parent 61c933f982
commit 97decf801a

View File

@ -43,7 +43,7 @@ export function throwIfNotSuccess(response) {
return new Promise((resolve, reject) => {
response.json().then(body => reject(new ForbiddenError(response.status, body)));
});
} else if (response.status > 399 && response.status < 404) {
} else if (response.status > 399 && response.status < 499) {
return new Promise((resolve, reject) => {
response.json().then(body => {
const errorMsg = body && body.isJoi ? extractJoiMsg(body) : extractLegacyMsg(body);