Commit 553e22ea authored by AnimeGitB's avatar AnimeGitB
Browse files

Add more explicit NoSuchFileException message for excels

parent 5878cb6f
...@@ -8,6 +8,7 @@ import java.lang.reflect.ParameterizedType; ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment