File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
delphi-frontend/src/main/java/au/com/integradev/delphi/executor Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 2626import au .com .integradev .delphi .preprocessor .directive .CompilerDirectiveParserImpl ;
2727import java .util .Set ;
2828import java .util .function .Function ;
29+ import org .slf4j .Logger ;
30+ import org .slf4j .LoggerFactory ;
2931import org .sonar .api .SonarProduct ;
3032import org .sonar .api .SonarRuntime ;
3133import org .sonar .api .batch .fs .InputFile ;
3739import org .sonar .plugins .communitydelphi .api .directive .CompilerDirectiveParser ;
3840
3941public class DelphiChecksExecutor implements Executor {
42+ private static final Logger LOG = LoggerFactory .getLogger (DelphiChecksExecutor .class );
43+
4044 private final DelphiProjectHelper delphiProjectHelper ;
4145 private final MasterCheckRegistrar checkRegistrar ;
4246 private final SonarRuntime sonarRuntime ;
@@ -79,9 +83,18 @@ private void runChecks(
7983 .forEach (
8084 check -> {
8185 DelphiCheckContext context = createCheckContext .apply (check );
82- check .start (context );
83- check .visit (context .getAst (), context );
84- check .end (context );
86+ try {
87+ check .start (context );
88+ check .visit (context .getAst (), context );
89+ check .end (context );
90+ } catch (Exception e ) {
91+ LOG .error (
92+ "Error occurred while running check {} on file: {}" ,
93+ check .getClass ().getSimpleName (),
94+ context .getAst ().getDelphiFile ().getSourceCodeFile ().getName (),
95+ e );
96+ LOG .info ("Continuing with next check." );
97+ }
8598 });
8699 }
87100
You can’t perform that action at this time.
0 commit comments