feat: Add error handler to CWIL

This commit is contained in:
Alireza authored and Erik Ziegler committed 2021-07-08 10:04:23 +02:00
1 parent e7b32cc51e
commit 70e4c55920
4 files changed
+23 -1

No files matched your search

+8
View File
@@ -39,6 +39,14 @@ window.config = {
configuration: {},
},
],
httpErrorHandler: error => {
// This is 429 when rejected from the public idc sandbox too often.
console.warn(error.status);
// Could use services manager here to bring up a dialog/modal if needed.
console.warn('test, navigate to https://ohif.org/');
window.location = 'https://ohif.org/';
},
// whiteLabeling: {
// /* Optional: Should return a React component to be rendered in the "Logo" section of the application's Top Navigation bar */
// createLogoComponentFn: function (React) {
+7
View File
@@ -14,6 +14,7 @@ import {
HangingProtocolService,
CineService,
UserAuthenticationService,
errorHandler
// utils,
} from '@ohif/core';
@@ -62,6 +63,12 @@ function appInit(appConfigOrFunc, defaultExtensions) {
UserAuthenticationService,
]);
errorHandler.getHTTPErrorHandler = () => {
if (typeof appConfig.httpErrorHandler === 'function') {
return appConfig.httpErrorHandler;
}
};
/**
* Example: [ext1, ext2, ext3]
* Example2: [[ext1, config], ext2, [ext3, config]]