fix: 站点检查多个ip连接超时的报错显示不出来的bug

This commit is contained in:
xiaojunnuo
2026-01-28 19:22:00 +08:00
parent 78004bdfb5
commit 33b284afc0
3 changed files with 24 additions and 10 deletions
@@ -1,5 +1,5 @@
import { Autoload, Config, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core';
import { logger } from '@certd/basic';
import { http, logger } from '@certd/basic';
import { UserService } from '../sys/authority/service/user-service.js';
import { PlusService, SysInstallInfo, SysPrivateSettings, SysSettingsService } from '@certd/lib-server';
import { nanoid } from 'nanoid';
@@ -177,11 +177,18 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
}
} catch (e) {
logger.error("check site error", e);
let message = e.message
if (!message){
message = e.code
}
if (e.errors &&e.errors.length > 0){
message += "\n"+e.errors.map((item:any)=>item.message).join("\n")
}
await this.update({
id: site.id,
checkStatus: "error",
lastCheckTime: dayjs().valueOf(),
error: e.message
error: message
});
if (!notify) {
return;