fix: improve error message

This commit is contained in:
Yarmo Mackenbach 2024-09-01 12:03:52 +02:00
parent 3681b9f86a
commit 324d3fd562
No known key found for this signature in database
GPG key ID: C248C28D432560ED

View file

@ -87,7 +87,7 @@ const doVerification = async (profile) => {
const validate = (profile) => {
const valid = apiProfileValidate(profile)
if (!valid) {
throw new Error(`Profile data validation error: ${apiProfileValidate.errors.map(x => x.message).join(', ')}`)
throw new Error(`API data validation error: ${apiProfileValidate.errors.map(x => `${x.instancePath} ${x.message}`).join(', ')}`)
}
}