2
0
mirror of https://github.com/frappe/books.git synced 2025-02-04 21:18:32 +00:00

fix: Better error message for Select validation

This commit is contained in:
Faris Ansari 2019-12-24 15:40:46 +05:30
parent 827cad114a
commit 6497d05627

View File

@ -267,7 +267,7 @@ module.exports = class BaseMeta extends BaseDocument {
} }
if (!validValues.includes(value)) { if (!validValues.includes(value)) {
throw new frappe.errors.ValueError( throw new frappe.errors.ValueError(
`${value} must be one of ${options.join(', ')}` `Invalid value "${value}" for "${field.label}". Must be one of ${options.join(', ')}`
); );
} }
return value; return value;