mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-12 13:48:35 +02:00
fix: should support 409 responses as well
This commit is contained in:
parent
61c933f982
commit
97decf801a
@ -43,7 +43,7 @@ export function throwIfNotSuccess(response) {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
response.json().then(body => reject(new ForbiddenError(response.status, body)));
|
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) => {
|
return new Promise((resolve, reject) => {
|
||||||
response.json().then(body => {
|
response.json().then(body => {
|
||||||
const errorMsg = body && body.isJoi ? extractJoiMsg(body) : extractLegacyMsg(body);
|
const errorMsg = body && body.isJoi ? extractJoiMsg(body) : extractLegacyMsg(body);
|
||||||
|
Loading…
Reference in New Issue
Block a user