diff --git a/packages/plugins/@nocobase/plugin-data-source-manager/src/server/models/data-source.ts b/packages/plugins/@nocobase/plugin-data-source-manager/src/server/models/data-source.ts index 4baa152fad..b4fd7e31ba 100644 --- a/packages/plugins/@nocobase/plugin-data-source-manager/src/server/models/data-source.ts +++ b/packages/plugins/@nocobase/plugin-data-source-manager/src/server/models/data-source.ts @@ -100,10 +100,11 @@ export class DataSourceModel extends Model { localData: await this.loadLocalData(), }); } catch (e) { - this.app.logger.error(`load data source failed, ${e.message}`); + app.logger.error(`load data source failed, ${e.message}`); pluginDataSourceManagerServer.dataSourceStatus[dataSourceKey] = 'failed'; pluginDataSourceManagerServer.dataSourceErrors[dataSourceKey] = e; + return; } pluginDataSourceManagerServer.dataSourceStatus[dataSourceKey] = 'loaded'; diff --git a/packages/plugins/@nocobase/plugin-data-source-manager/src/server/plugin.ts b/packages/plugins/@nocobase/plugin-data-source-manager/src/server/plugin.ts index baddde21a7..53bf4ba524 100644 --- a/packages/plugins/@nocobase/plugin-data-source-manager/src/server/plugin.ts +++ b/packages/plugins/@nocobase/plugin-data-source-manager/src/server/plugin.ts @@ -127,7 +127,7 @@ export class PluginDataSourceManagerServer extends Plugin { }; if (dataSourceStatus === 'failed') { - item['errorMessage'] = this.dataSourceErrors[dataSourceModel.get('key')].message; + item['errorMessage'] = plugin.dataSourceErrors[dataSourceModel.get('key')].message; } const dataSource = app.dataSourceManager.dataSources.get(dataSourceModel.get('key'));