fix(random names): log error message upon failure

This commit is contained in:
ineanto 2024-02-25 16:16:14 +01:00
parent 68ad4ac9b5
commit d784ed448f

View file

@ -27,10 +27,10 @@ public class RandomNameFetcher {
final String[] values = line.split("\n");
records.add(Arrays.asList(values));
}
return records.get(new Random().nextInt(records.size() - 1)).get(0);
} catch (IOException e) {
throw new RuntimeException(e);
instance.getLogger().severe("Unable to fetch random names.");
return "Ineanto";
}
return records.get(new Random().nextInt(records.size() - 1)).get(0);
}
}