package net.minecraft.util.filefix; import net.minecraft.CrashReport; import net.minecraft.CrashReportCategory; import net.minecraft.ReportedException; import org.jspecify.annotations.Nullable; public class FileFixException extends RuntimeException { @Nullable protected final FileSystemCapabilities fileSystemCapabilities; public FileFixException(@Nullable final Exception cause, @Nullable final FileSystemCapabilities fileSystemCapabilities) { super(cause); this.fileSystemCapabilities = fileSystemCapabilities; } protected CrashReport createCrashReport() { CrashReport crashReport = CrashReport.forThrowable(this, "Upgrading world failed with errors"); CrashReportCategory fsCapabilities = crashReport.addCategory("File system capabilities"); fsCapabilities.setDetail("Hard Links", this.fileSystemCapabilities == null ? "null" : this.fileSystemCapabilities.hardLinks()); fsCapabilities.setDetail("Atomic Move", this.fileSystemCapabilities == null ? "null" : this.fileSystemCapabilities.atomicMove()); return crashReport; } public ReportedException makeReportedException() { return new ReportedException(this.createCrashReport()); } }