Handle 200 status response and add default error handling (#5227)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
eedaa9a2e2
commit
c8261d9883
@ -25,12 +25,16 @@ export default function (wadoRoot, getAuthrorizationHeader) {
|
||||
//Call a function when the state changes.
|
||||
if (xhr.readyState == 4) {
|
||||
switch (xhr.status) {
|
||||
case 200:
|
||||
case 204:
|
||||
resolve(xhr.responseText);
|
||||
|
||||
break;
|
||||
case 404:
|
||||
reject('Your dataSource does not support reject functionality');
|
||||
default:
|
||||
reject(`Unexpected status code: ${xhr.status}`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user