double-check : Use validate and log error

This commit is contained in:
2025-10-05 16:50:25 +02:00
parent 53750e51f5
commit c021954eac
+4 -2
View File
@@ -14,10 +14,12 @@ export async function parse<S extends yup.Maybe<yup.AnyObject>>(schema: yup.Obje
if (!config.ok) return config
log.trace('double-check')
const res = await schema.isValid(config.data, {strict: true})
if (!res) {
try {
await schema.validate(config.data, {strict: true})
} catch (e) {
log.error('Double-check failed')
log.debug('Config', config.data)
log.debug('Error:', e)
return {ok: false}
}