mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-23 21:02:48 +00:00
Daemons should not swallow any exception (#969)
The "happy path" should happen without anything thrown, unsure why here runtime ex is rethrown, others swallowed. Change: just remove the try/catch and make method throw Exception (diff best seen with whitespace ignored). Fixes #957 Fixes #966
This commit is contained in:
@@ -717,8 +717,7 @@ public class DaemonMavenCli implements DaemonCli {
|
||||
}
|
||||
|
||||
private List<CoreExtensionEntry> loadCoreExtensions(
|
||||
List<CoreExtension> extensions, ClassRealm containerRealm, Set<String> providedArtifacts) {
|
||||
try {
|
||||
List<CoreExtension> extensions, ClassRealm containerRealm, Set<String> providedArtifacts) throws Exception {
|
||||
if (extensions.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@@ -768,13 +767,6 @@ public class DaemonMavenCli implements DaemonCli {
|
||||
executionRequestPopulator = null;
|
||||
container.dispose();
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
// runtime exceptions are most likely bugs in maven, let them bubble up to the user
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
slf4jLogger.warn("Failed to load extensions descriptor {}: {}", extensions, e.getMessage());
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
private ClassRealm setupContainerRealm(
|
||||
|
@@ -642,8 +642,7 @@ public class DaemonMavenCli implements DaemonCli {
|
||||
}
|
||||
|
||||
private List<CoreExtensionEntry> loadCoreExtensions(
|
||||
List<CoreExtension> extensions, ClassRealm containerRealm, Set<String> providedArtifacts) {
|
||||
try {
|
||||
List<CoreExtension> extensions, ClassRealm containerRealm, Set<String> providedArtifacts) throws Exception {
|
||||
if (extensions.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@@ -692,13 +691,6 @@ public class DaemonMavenCli implements DaemonCli {
|
||||
executionRequestPopulator = null;
|
||||
container.dispose();
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
// runtime exceptions are most likely bugs in maven, let them bubble up to the user
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
slf4jLogger.warn("Failed to load extensions descriptor {}: {}", extensions, e.getMessage());
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
private ClassRealm setupContainerRealm(
|
||||
|
Reference in New Issue
Block a user