monkey-front-core 22.2.0 → 22.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2023,10 +2023,12 @@ const DEFAULT_EXPOSED_MODULE = './Routes';
|
|
|
2023
2023
|
class MonkeyEcxFederationService {
|
|
2024
2024
|
constructor() {
|
|
2025
2025
|
this._configsService = inject(MonkeyEcxConfigsService);
|
|
2026
|
+
this._errorService = inject(MonkeyEcxErrorService);
|
|
2026
2027
|
this._federation = injectTokenWithWarning(MECX_FEDERATION, 'MECX_FEDERATION');
|
|
2027
2028
|
this._remotes$ = new BehaviorSubject({});
|
|
2028
2029
|
this._initialized$ = new BehaviorSubject(false);
|
|
2029
2030
|
this._loading = new Map();
|
|
2031
|
+
this._errorApplied = false;
|
|
2030
2032
|
}
|
|
2031
2033
|
get remotes$() {
|
|
2032
2034
|
return this._remotes$.asObservable();
|
|
@@ -2083,6 +2085,12 @@ class MonkeyEcxFederationService {
|
|
|
2083
2085
|
throw e;
|
|
2084
2086
|
}
|
|
2085
2087
|
}
|
|
2088
|
+
handleStartupError(name, setting, e) {
|
|
2089
|
+
if (!setting.holdSplash || this._errorApplied)
|
|
2090
|
+
return;
|
|
2091
|
+
this._errorApplied = true;
|
|
2092
|
+
this._errorService.apply(`Remote "${name}" | ${setting.host} | ${e?.message || e}`);
|
|
2093
|
+
}
|
|
2086
2094
|
apply() {
|
|
2087
2095
|
const federationSettings = this._configsService.bootstrap?.federationSettings || {};
|
|
2088
2096
|
const current = this._remotes$.value;
|
|
@@ -2096,9 +2104,9 @@ class MonkeyEcxFederationService {
|
|
|
2096
2104
|
.filter(([, setting]) => {
|
|
2097
2105
|
return setting.preload || setting.holdSplash;
|
|
2098
2106
|
})
|
|
2099
|
-
.forEach(([name]) => {
|
|
2100
|
-
this.load(name).catch(() => {
|
|
2101
|
-
|
|
2107
|
+
.forEach(([name, setting]) => {
|
|
2108
|
+
this.load(name).catch((e) => {
|
|
2109
|
+
this.handleStartupError(name, setting, e);
|
|
2102
2110
|
});
|
|
2103
2111
|
});
|
|
2104
2112
|
}
|