Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ export class DataSchemaCompiler {
errorsReport.error(`No transpilation result received for the file ${file.fileName}.`);
return undefined;
}
errorsReport.addErrors(res[index].errors);
errorsReport.addErrors(res[index].errors, file.fileName);
errorsReport.addWarnings(res[index].warnings as unknown as SyntaxErrorInterface[]);
errorsReport.exitFile();

Expand All @@ -654,7 +654,7 @@ export class DataSchemaCompiler {
errorsReport.error(`No transpilation result received for the file ${file.fileName}.`);
return undefined;
}
errorsReport.addErrors(res[index].errors);
errorsReport.addErrors(res[index].errors, file.fileName);
errorsReport.addWarnings(res[index].warnings as unknown as SyntaxErrorInterface[]);
errorsReport.exitFile();

Expand Down Expand Up @@ -686,7 +686,7 @@ export class DataSchemaCompiler {

errorsReport.inFile(file);
const res = await transpileJs([reqData]);
errorsReport.addErrors(res[0].errors);
errorsReport.addErrors(res[0].errors, file.fileName);
errorsReport.addWarnings(res[0].warnings as unknown as SyntaxErrorInterface[]);
errorsReport.exitFile();

Expand All @@ -701,7 +701,7 @@ export class DataSchemaCompiler {
};

const res = await this.workerPool!.exec('transpileJs', [data]);
errorsReport.addErrors(res.errors);
errorsReport.addErrors(res.errors, file.fileName);
errorsReport.addWarnings(res.warnings);

return { ...file, content: res.content };
Expand Down Expand Up @@ -761,7 +761,7 @@ export class DataSchemaCompiler {

errorsReport.inFile(file);
const res = await transpileYaml([reqData]);
errorsReport.addErrors(res[0].errors);
errorsReport.addErrors(res[0].errors, file.fileName);
errorsReport.addWarnings(res[0].warnings as unknown as SyntaxErrorInterface[]);
errorsReport.exitFile();

Expand All @@ -778,7 +778,7 @@ export class DataSchemaCompiler {
};

const res = await this.workerPool!.exec('transpileYaml', [data]);
errorsReport.addErrors(res.errors);
errorsReport.addErrors(res.errors, file.fileName);
errorsReport.addWarnings(res.warnings);

this.compiledYamlCache.set(cacheKey, res.content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ export class ErrorReporter {
return this.rootReporter().errors;
}

public addErrors(errors: PossibleError[]) {
errors.forEach((e: any) => { this.error(e); });
public addErrors(errors: PossibleError[], fileName?: string) {
errors.forEach((e: any) => { this.error(e, fileName); });
}

public getWarnings() {
Expand Down
Loading