修改exception时的笔误

This commit is contained in:
Xu Chang 2023-02-08 17:14:14 +08:00
parent f20a7e284c
commit c23b724e4d
2 changed files with 13 additions and 8 deletions

View File

@ -575,10 +575,13 @@ function createRemoveCheckers(schema, authDict) {
count: 1
}, { dontCollect: true });
if (result instanceof Promise) {
promises.push(result.then(function (rows) {
var err = new Exception_1.OakRowInconsistencyException(undefined, "\u60A8\u65E0\u6CD5\u5220\u9664\u5B58\u5728\u6709\u6548\u6570\u636E\u300C".concat(e, "\u300D\u5173\u8054\u7684\u884C"));
err.addData(e, rows);
throw err;
promises.push(result.then(function (_a) {
var _b = tslib_1.__read(_a, 1), row = _b[0];
if (row) {
var err = new Exception_1.OakRowInconsistencyException(undefined, "\u60A8\u65E0\u6CD5\u5220\u9664\u5B58\u5728\u6709\u6548\u6570\u636E\u300C".concat(e, "\u300D\u5173\u8054\u7684\u884C"));
err.addData(e, [row]);
throw err;
}
}));
}
else {

View File

@ -549,10 +549,12 @@ export function createRemoveCheckers<ED extends EntityDict & BaseEntityDict, Cxt
if (result instanceof Promise) {
promises.push(
result.then(
(rows) => {
const err = new OakRowInconsistencyException<ED>(undefined, `您无法删除存在有效数据「${e as string}」关联的行`);
err.addData(e, rows);
throw err;
([row]) => {
if (row) {
const err = new OakRowInconsistencyException<ED>(undefined, `您无法删除存在有效数据「${e as string}」关联的行`);
err.addData(e, [row]);
throw err;
}
}
)
);