Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-133130

Uncaught exception handler doesn't log the stacktrace


    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 18w44a
    • Minecraft 1.13-pre6, Minecraft 1.13-pre7, Minecraft 1.13-pre8, Minecraft 1.13-pre9, Minecraft 1.13-pre10, Minecraft 1.13, Minecraft 18w30a, Minecraft 18w30b, Minecraft 18w31a, Minecraft 1.13.2, Minecraft 18w50a
    • Unconfirmed

      One of the two UncaughtExceptionHandler implementations calls LOGGER.error(e). This only causes the toString of the exception to be logged, not the stacktrace. The affected implementation is the one obfuscated as e; the other implementation (f) calls LOGGER.error(t.getName(), e) and as such is not affected as it does log a message.

      An easy would be to simply change it to LOGGER.error("Caught previously unhandled exception", e) instead of having that message on a separate line. Log4j should already put it on a new line, so this should be the same behavior.

      An example of this in the wild is MC-127452 (I haven't evaluated that ticket in any other way; it just does have the message logged without a stacktrace).

      As far as I can tell, the relevant code was added in 18w06a.

            Unassigned Unassigned
            pokechu22 [Mod] Pokechu22
            0 Vote for this issue
            2 Start watching this issue