1
0
Fork 0
mirror of synced 2024-08-23 05:51:29 +12:00

Improve message

This commit is contained in:
Adria Navarro 2024-05-14 17:44:52 +02:00
parent 81801582e9
commit efb02a2c44

View file

@ -14,7 +14,11 @@ export async function processInputBBReference(
subtype: BBReferenceFieldSubType.USER
): Promise<string | null> {
if (value && Array.isArray(value)) {
throw "BB_REFERENCE_SINGLE cannot be an array"
throw new InvalidBBRefError(
JSON.stringify(value),
BBReferenceFieldSubType.USER,
"BB_REFERENCE_SINGLE cannot be an array"
)
}
let id = typeof value === "string" ? value : value?._id