fix: error message of uid field

This commit is contained in:
xilesun 2024-02-04 20:14:53 +08:00
parent e8138816f2
commit 9120955733

View File

@ -17,7 +17,9 @@ export class UidField extends Field {
} else if (re.test(value)) {
instance.set(name, value);
} else {
throw new Error(`Field names can only include A-Z, a-z, 0-9, _-*$, '${value}' is invalid`);
throw new Error(
`${this.collection.name}.${this.options.name} can only include A-Z, a-z, 0-9, _-*$, '${value}' is invalid`,
);
}
};
}