fix(ui): display error in ui while loading seg (#4433)
This commit is contained in:
parent
543c31109b
commit
2e96371b06
@ -122,12 +122,17 @@ function _load(
|
|||||||
// and also return the same promise to any other callers.
|
// and also return the same promise to any other callers.
|
||||||
loadPromises[SOPInstanceUID] = new Promise(async (resolve, reject) => {
|
loadPromises[SOPInstanceUID] = new Promise(async (resolve, reject) => {
|
||||||
if (!segDisplaySet.segments || Object.keys(segDisplaySet.segments).length === 0) {
|
if (!segDisplaySet.segments || Object.keys(segDisplaySet.segments).length === 0) {
|
||||||
await _loadSegments({
|
try {
|
||||||
extensionManager,
|
await _loadSegments({
|
||||||
servicesManager,
|
extensionManager,
|
||||||
segDisplaySet,
|
servicesManager,
|
||||||
headers,
|
segDisplaySet,
|
||||||
});
|
headers,
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
segDisplaySet.loading = false;
|
||||||
|
return reject(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const suppressEvents = true;
|
const suppressEvents = true;
|
||||||
|
|||||||
@ -242,7 +242,18 @@ class CornerstoneCacheService {
|
|||||||
if (displaySet.load && displaySet.load instanceof Function) {
|
if (displaySet.load && displaySet.load instanceof Function) {
|
||||||
const { userAuthenticationService } = this.servicesManager.services;
|
const { userAuthenticationService } = this.servicesManager.services;
|
||||||
const headers = userAuthenticationService.getAuthorizationHeader();
|
const headers = userAuthenticationService.getAuthorizationHeader();
|
||||||
await displaySet.load({ headers });
|
|
||||||
|
try {
|
||||||
|
await displaySet.load({ headers });
|
||||||
|
} catch (e) {
|
||||||
|
const { uiNotificationService } = this.servicesManager.services;
|
||||||
|
uiNotificationService.show({
|
||||||
|
title: 'Error loading displaySet',
|
||||||
|
message: e.message,
|
||||||
|
type: 'error',
|
||||||
|
});
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
|
||||||
// Parametric maps have a `load` method but it should not be loaded in the
|
// Parametric maps have a `load` method but it should not be loaded in the
|
||||||
// same way as SEG and RTSTRUCT but like a normal volume
|
// same way as SEG and RTSTRUCT but like a normal volume
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user