mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-13 07:25:08 +01:00
Add more explicit NoSuchFileException message for excels
This commit is contained in:
@@ -8,6 +8,7 @@ import java.lang.reflect.ParameterizedType;
|
|||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.NoSuchFileException;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -446,7 +447,7 @@ public class TsvUtils {
|
|||||||
}
|
}
|
||||||
}).toList();
|
}).toList();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Grasscutter.getLogger().error("Error loading TSV file '"+filename+"' - Stacktrace is: ", e);
|
Grasscutter.getLogger().error("Error loading file '"+filename+"' - Stacktrace is: ", e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -487,11 +488,14 @@ public class TsvUtils {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}).toList();
|
}).toList();
|
||||||
|
} catch (NoSuchFileException e) {
|
||||||
|
Grasscutter.getLogger().error("Error loading file '"+filename+"' - File does not exist. You are missing resources. Note that this file may exist in JSON, TSV, or TSJ format, any of which are suitable.");
|
||||||
|
return null;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Grasscutter.getLogger().error("Error loading TSV file '"+filename+"' - Stacktrace is: ", e);
|
Grasscutter.getLogger().error("Error loading file '"+filename+"' - Stacktrace is: ", e);
|
||||||
return null;
|
return null;
|
||||||
} catch (NoSuchMethodException e) {
|
} catch (NoSuchMethodException e) {
|
||||||
Grasscutter.getLogger().error("Error loading TSV file '"+filename+"' - Class is missing NoArgsConstructor");
|
Grasscutter.getLogger().error("Error loading file '"+filename+"' - Class is missing NoArgsConstructor");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -588,7 +592,7 @@ public class TsvUtils {
|
|||||||
}
|
}
|
||||||
}).toList();
|
}).toList();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Grasscutter.getLogger().error("Error loading TSV file '"+filename+"' - Stacktrace is: ", e);
|
Grasscutter.getLogger().error("Error loading file '"+filename+"' - Stacktrace is: ", e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|||||||
Reference in New Issue
Block a user