Skip to content

Commit 9961ada

Browse files
committed
fix filename passed to errorReporter
1 parent 60c006e commit 9961ada

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/cubejs-schema-compiler/src/compiler/CubeValidator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ export class CubeValidator {
10011001
const result = cube.isView ? viewSchema.validate(cube, options) : cubeSchema.validate(cube, options);
10021002

10031003
if (result.error != null) {
1004-
errorReporter.error(formatErrorMessage(result.error), result.error);
1004+
errorReporter.error(formatErrorMessage(result.error));
10051005
} else {
10061006
this.validCubes.set(cube.name, true);
10071007
}

packages/cubejs-schema-compiler/src/compiler/DataSchemaCompiler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ export class DataSchemaCompiler {
631631
return files.map((file, index) => {
632632
errorsReport.inFile(file);
633633
if (!res[index]) { // This should not happen in theory but just to be safe
634-
errorsReport.error(`No transpilation result received for the file ${file.fileName}.`);
634+
errorsReport.error('No transpilation result received for the file.');
635635
return undefined;
636636
}
637637
errorsReport.addErrors(res[index].errors, file.fileName);
@@ -658,7 +658,7 @@ export class DataSchemaCompiler {
658658
return files.map((file, index) => {
659659
errorsReport.inFile(file);
660660
if (!res[index]) { // This should not happen in theory but just to be safe
661-
errorsReport.error(`No transpilation result received for the file ${file.fileName}.`);
661+
errorsReport.error('No transpilation result received for the file.');
662662
return undefined;
663663
}
664664
errorsReport.addErrors(res[index].errors, file.fileName);
@@ -737,7 +737,7 @@ export class DataSchemaCompiler {
737737
const err = e as SyntaxErrorInterface;
738738
const line = file.content.split('\n')[(err.loc?.start?.line || 1) - 1];
739739
const spaces = Array(err.loc?.start.column).fill(' ').join('');
740-
errorsReport.error(`Syntax error during '${file.fileName}' parsing: ${err.message}:\n${line}\n${spaces}^`);
740+
errorsReport.error(`Syntax error during parsing: ${err.message}:\n${line}\n${spaces}^`, file.fileName);
741741
} else {
742742
errorsReport.error(e);
743743
}

0 commit comments

Comments
 (0)