MCPcopy Index your code
hub / github.com/SAP/ui5-project / formatError

Method formatError

lib/validation/ValidationError.js:66–75  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

64 }
65
66 formatError(error) {
67 let errorMessage = ValidationError.formatMessage(error);
68 if (this.yaml && this.yaml.path && this.yaml.source) {
69 const yamlExtract = ValidationError.getYamlExtract({error, yaml: this.yaml});
70 const errorLines = errorMessage.split("\n");
71 errorLines.splice(1, 0, "\n" + yamlExtract);
72 errorMessage = errorLines.join("\n");
73 }
74 return errorMessage;
75 }
76
77 static formatMessage(error) {
78 if (error.keyword === "errorMessage") {

Callers 1

formatErrorsMethod · 0.95

Calls 3

formatMessageMethod · 0.80
getYamlExtractMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected