From 9120955733a863e632bf6a48fb49f6c2c7511784 Mon Sep 17 00:00:00 2001 From: xilesun <2013xile@gmail.com> Date: Sun, 4 Feb 2024 20:14:53 +0800 Subject: [PATCH] fix: error message of uid field --- packages/core/database/src/fields/uid-field.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/database/src/fields/uid-field.ts b/packages/core/database/src/fields/uid-field.ts index 358202fe5..cd80119d1 100644 --- a/packages/core/database/src/fields/uid-field.ts +++ b/packages/core/database/src/fields/uid-field.ts @@ -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`, + ); } }; }