mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-24 05:05:10 +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(
|
private List<CoreExtensionEntry> loadCoreExtensions(
|
||||||
List<CoreExtension> extensions, ClassRealm containerRealm, Set<String> providedArtifacts) {
|
List<CoreExtension> extensions, ClassRealm containerRealm, Set<String> providedArtifacts) throws Exception {
|
||||||
try {
|
|
||||||
if (extensions.isEmpty()) {
|
if (extensions.isEmpty()) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
@@ -768,13 +767,6 @@ public class DaemonMavenCli implements DaemonCli {
|
|||||||
executionRequestPopulator = null;
|
executionRequestPopulator = null;
|
||||||
container.dispose();
|
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(
|
private ClassRealm setupContainerRealm(
|
||||||
|
@@ -642,8 +642,7 @@ public class DaemonMavenCli implements DaemonCli {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List<CoreExtensionEntry> loadCoreExtensions(
|
private List<CoreExtensionEntry> loadCoreExtensions(
|
||||||
List<CoreExtension> extensions, ClassRealm containerRealm, Set<String> providedArtifacts) {
|
List<CoreExtension> extensions, ClassRealm containerRealm, Set<String> providedArtifacts) throws Exception {
|
||||||
try {
|
|
||||||
if (extensions.isEmpty()) {
|
if (extensions.isEmpty()) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
@@ -692,13 +691,6 @@ public class DaemonMavenCli implements DaemonCli {
|
|||||||
executionRequestPopulator = null;
|
executionRequestPopulator = null;
|
||||||
container.dispose();
|
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(
|
private ClassRealm setupContainerRealm(
|
||||||
|
Reference in New Issue
Block a user