Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Remove stacktrace on exception from reading server.properties

Open Machine-Maker opened this issue 2 years ago • 3 comments

1.20 added a full stacktrace to the error message when the server.properties doesn't exist. This stacktrace shouldn't be printed, really. The exception type+message should suffice.

If we want to be more specific, we could just skip the stacktrace if the exception is FileNotFoundException, but I feel like this is fine.

Machine-Maker avatar Jun 10 '23 01:06 Machine-Maker

Don't we have a patch that does something similar (removes vanilla exceptions)? Would be nice to merge perhaps.

Owen1212055 avatar Jun 10 '23 06:06 Owen1212055

Yea this would fit nicely into https://github.com/PaperMC/Paper/blob/master/patches/server/0920-Improve-logging-and-errors.patch

(honestly, might as well move "Remove invalid signature login stacktrace" patch into that one too)

lynxplay avatar Jun 10 '23 06:06 lynxplay

Refactored to just check if server.properties exists at all before trying to read from it. If it doesn't, just return empty properties and log a regular line saying default values are being used.

Machine-Maker avatar Jun 11 '23 00:06 Machine-Maker