Skip to content

Commit

Permalink
Resolve issue SonarSource#4586
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmorand-sonarsource committed Mar 19, 2024
1 parent fba5e23 commit de0adb2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private void processParsingError(BridgeServer.ParsingError parsingError) {
String message = parsingError.message;

if (line != null) {
LOG.error("Failed to parse file [{}] at line {}: {}", file, line, message);
LOG.warn("Failed to parse file [{}] at line {}: {}", file, line, message);
} else if (parsingError.code == BridgeServer.ParsingErrorCode.FAILING_TYPESCRIPT) {
LOG.error("Failed to analyze file [{}] from TypeScript: {}", file, message);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ void should_raise_a_parsing_error() throws IOException {
assertThat(issue.primaryLocation().textRange().start().line()).isEqualTo(1);
assertThat(issue.primaryLocation().message()).isEqualTo("Parse error message");
assertThat(context.allAnalysisErrors()).hasSize(1);
assertThat(logTester.logs(LoggerLevel.ERROR))
assertThat(logTester.logs(LoggerLevel.WARN))
.contains("Failed to parse file [dir/file.html] at line 1: Parse error message");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ void should_raise_a_parsing_error() throws IOException {
assertThat(issue.primaryLocation().textRange().start().line()).isEqualTo(3);
assertThat(issue.primaryLocation().message()).isEqualTo("Parse error message");
assertThat(context.allAnalysisErrors()).hasSize(1);
assertThat(logTester.logs(LoggerLevel.ERROR))
assertThat(logTester.logs(LoggerLevel.WARN))
.contains("Failed to parse file [dir/file.js] at line 3: Parse error message");
}

Expand All @@ -615,7 +615,7 @@ void should_not_create_parsing_issue_when_no_rule() throws IOException {
Collection<Issue> issues = context.allIssues();
assertThat(issues).isEmpty();
assertThat(context.allAnalysisErrors()).hasSize(1);
assertThat(logTester.logs(LoggerLevel.ERROR))
assertThat(logTester.logs(LoggerLevel.WARN))
.contains("Failed to parse file [dir/file.js] at line 3: Parse error message");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ void should_raise_a_parsing_error() throws IOException {
assertThat(issue.primaryLocation().textRange().start().line()).isEqualTo(3);
assertThat(issue.primaryLocation().message()).isEqualTo("Parse error message");
assertThat(context.allAnalysisErrors()).hasSize(1);
assertThat(logTester.logs(LoggerLevel.ERROR))
assertThat(logTester.logs(LoggerLevel.WARN))
.contains("Failed to parse file [dir/file.ts] at line 3: Parse error message");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void should_raise_a_parsing_error() throws IOException {
assertThat(issue.primaryLocation().textRange().start().line()).isEqualTo(1);
assertThat(issue.primaryLocation().message()).isEqualTo("Parse error message");
assertThat(context.allAnalysisErrors()).hasSize(1);
assertThat(logTester.logs(LoggerLevel.ERROR))
assertThat(logTester.logs(LoggerLevel.WARN))
.contains("Failed to parse file [dir/file.yaml] at line 1: Parse error message");
}

Expand Down

0 comments on commit de0adb2

Please sign in to comment.