Browse Source

enhancement: add try catch for covering search mismatch type

pull/3444/head
Wing-Kam Wong 2 years ago
parent
commit
9bf5181934
  1. 22
      packages/nocodb/src/lib/meta/api/dataApis/dataAliasApis.ts

22
packages/nocodb/src/lib/meta/api/dataApis/dataAliasApis.ts

@ -107,14 +107,20 @@ async function getDataList(model, view: View, req) {
listArgs.sortArr = JSON.parse(listArgs.sortArrJson);
} catch (e) {}
const data = await nocoExecute(
requestObj,
await baseModel.list(listArgs),
{},
listArgs
);
const count = await baseModel.count(listArgs);
let data = [];
let count = 0;
try {
data = await nocoExecute(
requestObj,
await baseModel.list(listArgs),
{},
listArgs
);
count = await baseModel.count(listArgs);
} catch (_) {
// show empty result instead of throwing error here
// e.g. search some text in a numeric field
}
return new PagedResponseImpl(data, {
...req.query,

Loading…
Cancel
Save