From 71a331a043d43340cb2c49d24cbc7fc29381eccf Mon Sep 17 00:00:00 2001 From: why520crazy Date: Fri, 18 Dec 2020 09:24:17 +0800 Subject: [PATCH] fix(component): update error message when component is not registered --- packages/planet/src/component/planet-component-loader.spec.ts | 2 +- packages/planet/src/component/planet-component-loader.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/planet/src/component/planet-component-loader.spec.ts b/packages/planet/src/component/planet-component-loader.spec.ts index ceb24d0..9211022 100644 --- a/packages/planet/src/component/planet-component-loader.spec.ts +++ b/packages/planet/src/component/planet-component-loader.spec.ts @@ -64,7 +64,7 @@ describe('PlanetComponentLoader', () => { expect(() => { loadApp1Component(app2ModuleRef); - }).toThrowError(`${app1Name} not registered components`); + }).toThrowError(`${app1Name}'s component(app1-projects) is not registered`); registerAppComponents(app1ModuleRef); tick(); diff --git a/packages/planet/src/component/planet-component-loader.ts b/packages/planet/src/component/planet-component-loader.ts index 5eb8a8a..0615ed6 100644 --- a/packages/planet/src/component/planet-component-loader.ts +++ b/packages/planet/src/component/planet-component-loader.ts @@ -157,7 +157,7 @@ export class PlanetComponentLoader { if (componentFactory) { return componentFactory(componentName, config); } else { - throw new Error(`${app} not registered components`); + throw new Error(`${app}'s component(${componentName}) is not registered`); } }), finalize(() => {