@qrvey/formula-lang
Version:
QFormula support for qrvey projects
39 lines • 1.19 kB
JavaScript
import { ERROR_LIST } from '../dictionary';
export function getInfo(errorObj) {
let { type: { message, reasons, types }, } = errorObj;
message = message !== null && message !== void 0 ? message : '';
reasons = reasons !== null && reasons !== void 0 ? reasons : [];
types = types !== null && types !== void 0 ? types : [];
const messageList = [message, ...reasons, ...types];
return {
errorList,
messageList,
};
}
const errorList = [
{
regex: /.* Cannot apply .* operation to types .* and .*/,
value: ERROR_LIST.unknownToken,
},
{
regex: /.* document doesn't have a value .* Use .*size\(\)==0 to check if a document is missing a field.*/,
value: ERROR_LIST.nulls,
},
{
regex: /string_index_out_of_bounds_exception/,
value: ERROR_LIST.outOfRange,
},
{
regex: /cannot resolve symbol .*/,
value: ERROR_LIST.unknownToken,
},
{
regex: /Invalid int constant .*/,
value: ERROR_LIST.invalidCastNumber,
},
{
regex: /null_pointer_exception/,
value: ERROR_LIST.nulls,
},
];
//# sourceMappingURL=elasticsearch.js.map