MCPcopy Create free account
hub / github.com/SAP/ui5-project / formatErrors

Method formatErrors

lib/validation/ValidationError.js:45–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43 }
44
45 formatErrors() {
46 let separator = "\n\n";
47 if (process.stdout.isTTY) {
48 // Add a horizontal separator line between errors in case a terminal is used
49 separator += chalk.grey.dim("\u2500".repeat(process.stdout.columns || 80));
50 }
51 separator += "\n\n";
52 let message;
53
54 if (this.project) { // ui5-workspace.yaml is project independent, so in that case, no project is available
55 message = chalk.red(`Invalid ui5.yaml configuration for project ${this.project.id}`) + "\n\n";
56 } else {
57 message = chalk.red(`Invalid workspace configuration.`) + "\n\n";
58 }
59
60 message += this.errors.map((error) => {
61 return this.formatError(error);
62 }).join(separator);
63 return message;
64 }
65
66 formatError(error) {
67 let errorMessage = ValidationError.formatMessage(error);

Callers 1

constructorMethod · 0.95

Calls 2

formatErrorMethod · 0.95
joinMethod · 0.80

Tested by

no test coverage detected