Merge branch 'main' into next

This commit is contained in:
nocobase[bot] 2024-12-03 07:05:13 +00:00
commit 32fa387caa

View File

@ -178,9 +178,7 @@ export class Gateway extends EventEmitter {
} }
responseErrorWithCode(code, res, options) { responseErrorWithCode(code, res, options) {
const log = this.getLogger(options.appName, res);
const error = applyErrorWithArgs(getErrorWithCode(code), options); const error = applyErrorWithArgs(getErrorWithCode(code), options);
log.error(error.message, { method: 'responseErrorWithCode', error });
this.responseError(res, error); this.responseError(res, error);
} }
@ -233,8 +231,6 @@ export class Gateway extends EventEmitter {
} }
const handleApp = await this.getRequestHandleAppName(req as IncomingRequest); const handleApp = await this.getRequestHandleAppName(req as IncomingRequest);
const log = this.getLogger(handleApp, res);
const hasApp = AppSupervisor.getInstance().hasApp(handleApp); const hasApp = AppSupervisor.getInstance().hasApp(handleApp);
if (!hasApp) { if (!hasApp) {
@ -244,7 +240,6 @@ export class Gateway extends EventEmitter {
let appStatus = AppSupervisor.getInstance().getAppStatus(handleApp, 'initializing'); let appStatus = AppSupervisor.getInstance().getAppStatus(handleApp, 'initializing');
if (appStatus === 'not_found') { if (appStatus === 'not_found') {
log.warn(`app not found`, { method: 'requestHandler' });
this.responseErrorWithCode('APP_NOT_FOUND', res, { appName: handleApp }); this.responseErrorWithCode('APP_NOT_FOUND', res, { appName: handleApp });
return; return;
} }
@ -263,7 +258,6 @@ export class Gateway extends EventEmitter {
const app = await AppSupervisor.getInstance().getApp(handleApp); const app = await AppSupervisor.getInstance().getApp(handleApp);
if (appStatus !== 'running') { if (appStatus !== 'running') {
log.warn(`app is not running`, { method: 'requestHandler', status: appStatus });
this.responseErrorWithCode(`${appStatus}`, res, { app, appName: handleApp }); this.responseErrorWithCode(`${appStatus}`, res, { app, appName: handleApp });
return; return;
} }