Output semantic exceptions in pipeline. (#510)
* Output semantic exceptions in pipeline. * Change console output.
This commit is contained in:
Родитель
7580d59a80
Коммит
8de3343464
|
@ -167,8 +167,27 @@ export async function validateSpec(
|
|||
}
|
||||
return validator.specValidationResult
|
||||
} catch (err) {
|
||||
// console.log(err)
|
||||
log.error(err)
|
||||
let outputMsg = err
|
||||
if (typeof err === "object") {
|
||||
outputMsg = jsYaml.dump(err)
|
||||
}
|
||||
if (o.pretty) {
|
||||
if (process.env["Agent.Id"]) {
|
||||
/* tslint:disable-next-line:no-console no-string-literal */
|
||||
console.error(vsoLogIssueWrapper("error", `Semantically validating ${specPath}:\n`))
|
||||
/* tslint:disable-next-line:no-console no-string-literal */
|
||||
console.error(vsoLogIssueWrapper("error", outputMsg))
|
||||
} else {
|
||||
/* tslint:disable-next-line:no-console no-string-literal */
|
||||
console.error(`Semantically validating ${specPath}:\n`)
|
||||
/* tslint:disable-next-line:no-console no-string-literal */
|
||||
console.error("\x1b[31m", "error", ":", "\x1b[0m")
|
||||
// tslint:disable-next-line: no-console
|
||||
console.error(outputMsg)
|
||||
}
|
||||
} else {
|
||||
log.error(outputMsg)
|
||||
}
|
||||
validator.specValidationResult.validityStatus = false
|
||||
return validator.specValidationResult
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче