diff --git a/packages/less-ts-cli/src/lessc.ts b/packages/less-ts-cli/src/lessc.ts index 87166aa..0873201 100644 --- a/packages/less-ts-cli/src/lessc.ts +++ b/packages/less-ts-cli/src/lessc.ts @@ -37,9 +37,12 @@ const run = (y: yargs.Arguments): void => { } else { const result = compiler.compile(source); console.log(result.css); - for (const err of result.errors) { - const msg = err.errors.map((e) => e.message).join(', '); - console.error(`Error ${msg}`); + + if (result.errors) { + const msgs = compiler.formatErrors(result.errors); + for (const m of msgs) { + console.error(m); + } } } } catch (e) {