UNPKG

@qrvey/formula-lang

Version:

QFormula support for qrvey projects

51 lines 1.5 kB
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: /cannot apply the .* operator .* to the types .* and .*/, value: ERROR_LIST.nulls, }, { regex: /Cannot cast from .* to .*/, value: ERROR_LIST.nulls, }, { 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: /.* Cannot cast from .* to .*/, value: ERROR_LIST.unknownToken, }, { regex: /null_pointer_exception/, value: ERROR_LIST.nulls, }, ]; //# sourceMappingURL=elasticsearch.js.map