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:
MatheusRdkandCopilot authored and GitHub committed 2025-07-23 14:14:08 -04:00
1 parent eedaa9a2e2
commit c8261d9883
1 file changed
+4
@@ -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;
}
}
};