chore: error message

This commit is contained in:
Chareice 2023-05-08 12:06:13 +08:00
parent 00ce83e236
commit bc4762e59c

View File

@ -249,6 +249,11 @@ export class OptionsParser {
}
if (appendFields.length == 2) {
const association = associations[appendFields[0]];
if (!association) {
throw new Error(`association ${appendFields[0]} in ${model.name} not found`);
}
const associationModel = associations[appendFields[0]].target;
if (associationModel.rawAttributes[appendFields[1]]) {
lastLevel = true;