fix(xo-cli): fix invalid parameters error message

Introduced by d7f29e736

The error format has changed due to the switch of xo-server to Ajv.
This commit is contained in:
Julien Fontanet
2022-11-20 23:44:50 +01:00
parent 5ad94504e3
commit 65daa39ebe
2 changed files with 4 additions and 1 deletions

View File

@@ -31,6 +31,7 @@
- @xen-orchestra/backups-cli major
- @xen-orchestra/log minor
- xo-cli patch
- xo-web minor
<!--packages-end-->

View File

@@ -273,7 +273,9 @@ async function main(args) {
const lines = [error.message]
const { errors } = error.data
errors.forEach(error => {
lines.push(` property ${error.property}: ${error.message}`)
let { instancePath } = error
instancePath = instancePath.length === 0 ? '@' : '@.' + instancePath
lines.push(` property ${instancePath}: ${error.message}`)
})
throw lines.join('\n')
})