Trying to load a non-existent structure writes exception type to log
The bug
When trying to load a non-existent structure the exception type is written to the log file. Since a missing file is something which can be expected, a simple error message like "The structure file %s does not exist" or similar should be sufficient. For all other exceptions the stack trace should be written to the log since it could be useful when trying to find the reason why an exception was thrown.
Created Issue:
Trying to load a non-existent structure writes stack trace to log
The bug
When trying to load a non-existent structure the exception stack trace is written to the log file. Since a missing file should not be caused by the code the stack trace is not needed, instead a simple error message like "The structure file %s does not exist" or similar should be sufficient.
Update
In the latest versions only the exception type appears to be written in the log, that is even worse. For example java.io.IOException could be caused by all kind of stuff. Instead as suggested it should be tested if the file exists because that is rather something which can be expected. In all other cases the complete stack trace should be written to the log again.
Trying to load a non-existent structure writesstack trace to logTrying to load a non-existent structure writes exception type to log
The bug
When trying to load a non-existent structure the exception stack trace is written to the log file. Since a missing file should not be caused by the code the stack trace is not needed, instead a simple error message like "The structure file %s does not exist" or similar should be sufficient.
Update
In the latest versions onlythe exception type appears to be written in the log, that is even worse. For examplejava.io.IOExceptioncould be caused by all kind of stuff. Instead as suggesteditshould betested if the file exists because that is rather something which can be expected. In all other cases the complete stack trace should be written to the log again.The bug
When trying to load a non-existent structure the exception type is written to the log file. Since a missing file is something which can be expected, a simple error message like "The structure file %s does not exist" or similar should be sufficient. For all other exceptions the stack trace should be written to the log since it could be useful when trying to find the reason why an exception was thrown.
Fixed at some point. Now only prints "Couldn't load structure minecraft:testdsfsdfdsf: java.io.FileNotFoundException: minecraft:structures/testdsfsdfdsf.nbt" into log.
Not fixed in my opinion, only worse now.
Only showing the exception type if not that helpful, showing the stacktrace is fine but something as expectable as a file not existing should be caught.
Tested this in 20w08a. Now prints a simple "Structure 'minecraft:foo' is not available" message in chat. There are no exception being thrown in the log.
Yes in 20w08a (and probably earlier) logging is now implemented as suggested.