From b5945a0673a8863e1be9bc44396022c206425d67 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Thu, 29 Feb 2024 10:38:16 -0500 Subject: [PATCH] fix: add exception catch --- src/main/java/net/guizhanss/fastmachines/FastMachines.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/guizhanss/fastmachines/FastMachines.java b/src/main/java/net/guizhanss/fastmachines/FastMachines.java index 3312b62..3368cf4 100644 --- a/src/main/java/net/guizhanss/fastmachines/FastMachines.java +++ b/src/main/java/net/guizhanss/fastmachines/FastMachines.java @@ -85,7 +85,11 @@ public void enable() { log(Level.INFO, "Loading language..."); String lang = config.getString("lang", DEFAULT_LANG); localization = new LocalizationService(this, getFile()); - localization.addLanguage(lang); + try { + localization.addLanguage(lang); + } catch (Exception e) { + log(Level.SEVERE, "An error has occurred while loading language " + lang); + } if (!lang.equals(DEFAULT_LANG)) { localization.addLanguage(DEFAULT_LANG); }