Crash if file was not deleted
This commit is contained in:
parent
b75a0cfbdf
commit
cab557e439
2 changed files with 7 additions and 3 deletions
|
@ -44,8 +44,11 @@ public class FileHandler {
|
|||
public void removeFiles(List<RelationFile> rels) {
|
||||
for (RelationFile rel : rels) {
|
||||
File f = getFile(rel.dir, rel.filename());
|
||||
if (f.exists())
|
||||
f.delete();
|
||||
if (f.exists()) {
|
||||
if (!f.delete()) {
|
||||
throw new RuntimeException("Updater is not able to delete File. Please delete it manually: " + f.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.launchwrapper.LaunchClassLoader;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public class UpdateTweaker implements ITweaker {
|
||||
|
@ -54,7 +55,7 @@ public class UpdateTweaker implements ITweaker {
|
|||
config.toJson(writer);
|
||||
writer.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue