Skip to content

Commit

Permalink
Improve entrypoint exception handling a bit. Should help with debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexIIL committed Jul 9, 2023
1 parent be3bcc1 commit cb54b62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,11 @@ public <T> List<T> getEntrypoints(String key, Class<T> type) {
results.add(result);
}
} catch (Throwable t) {
QuiltEntrypointException e2 = new QuiltEntrypointException(key, entry.getModContainer().metadata().id(), t);
if (exception == null) {
exception = new QuiltEntrypointException(key, entry.getModContainer().metadata().id(), t);
exception = e2;
} else {
exception.addSuppressed(t);
exception.addSuppressed(e2);
}
}
}
Expand Down Expand Up @@ -209,10 +210,11 @@ public <T> List<EntrypointContainer<T>> getEntrypointContainers(String key, Clas

container = new EntrypointContainerImpl<>(entry.getModContainer(), instance);
} catch (Throwable t) {
QuiltEntrypointException e2 = new QuiltEntrypointException(key, entry.getModContainer().metadata().id(), t);
if (exc == null) {
exc = new QuiltEntrypointException(key, entry.getModContainer().metadata().id(), t);
exc = e2;
} else {
exc.addSuppressed(t);
exc.addSuppressed(e2);
}

continue;
Expand All @@ -221,7 +223,7 @@ public <T> List<EntrypointContainer<T>> getEntrypointContainers(String key, Clas
container = new EntrypointContainerImpl<>(entry.getModContainer(), () -> {
try {
return entry.getOrCreate(type);
} catch (Exception ex) {
} catch (Exception | LinkageError ex) {
throw new QuiltEntrypointException(key, entry.getModContainer().metadata().id(), ex);
}
});
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/changelog/0.20.0.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Features:

* Improved entrypoint exception handling a bit.

Bug Fixes:

* Fixed the mods table being empty if quilt-loader crashed too early.

0 comments on commit cb54b62

Please sign in to comment.