Paper
Paper copied to clipboard
Remove stacktrace on exception from reading server.properties
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.
Don't we have a patch that does something similar (removes vanilla exceptions)? Would be nice to merge perhaps.
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)
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.