fix(ui): show ui notification on displaySet load error (#4447)

This commit is contained in:
Pedro H. Köhler 2024-10-30 11:15:48 -03:00 committed by GitHub
parent 0166956dd8
commit 4f20523109
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -174,6 +174,7 @@ class CornerstoneCacheService {
initialImageIndex,
viewportType: Enums.ViewportType
): Promise<StackViewportData> {
const { uiNotificationService } = this.servicesManager.services;
const overlayDisplaySets = displaySets.filter(ds => ds.isOverlayDisplaySet);
const nonOverlayDisplaySets = displaySets.filter(ds => !ds.isOverlayDisplaySet);
@ -182,7 +183,16 @@ class CornerstoneCacheService {
if (overlayDisplaySet.load && overlayDisplaySet.load instanceof Function) {
const { userAuthenticationService } = this.servicesManager.services;
const headers = userAuthenticationService.getAuthorizationHeader();
await overlayDisplaySet.load({ headers });
try {
await overlayDisplaySet.load({ headers });
} catch (e) {
uiNotificationService.show({
title: 'Error loading overlayDisplaySet',
message: e.message,
type: 'error',
});
console.error(e);
}
}
}
@ -191,7 +201,17 @@ class CornerstoneCacheService {
if (displaySet.load && displaySet.load instanceof Function) {
const { userAuthenticationService } = this.servicesManager.services;
const headers = userAuthenticationService.getAuthorizationHeader();
await displaySet.load({ headers });
try {
await displaySet.load({ headers });
} catch (e) {
uiNotificationService.show({
title: 'Error loading displaySet',
message: e.message,
type: 'error',
});
console.error(e);
}
}
let stackImageIds = this.stackImageIds.get(displaySet.displaySetInstanceUID);