From 1a196d9fb3cb50bdb7829f5c5619475765b573f1 Mon Sep 17 00:00:00 2001 From: floppydiskette Date: Thu, 5 Sep 2024 03:36:25 +0100 Subject: [PATCH] Config error logging changes --- src/main/java/net/hypr/doki/Config.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/hypr/doki/Config.java b/src/main/java/net/hypr/doki/Config.java index 72b5395..8585fce 100644 --- a/src/main/java/net/hypr/doki/Config.java +++ b/src/main/java/net/hypr/doki/Config.java @@ -6,7 +6,7 @@ import java.io.*; import java.nio.charset.StandardCharsets; //You can add more fields in this class, if your input json matches the structure -//You will need a valid config.json in the package com.freya02.bot for this to work +//You will need a valid config.json in the resources folder for this to work public class Config { @SuppressWarnings("unused") private String token; @SuppressWarnings("unused") private String prefix; @@ -24,14 +24,7 @@ public class Config { Reader reader = new InputStreamReader(in, StandardCharsets.UTF_8); return new Gson().fromJson(reader, Config.class); } catch (IOException | NullPointerException e) { - throw new IOException(""" - config.json was not found in the root folder (of the project), did you forget to put it ? - Example structure: - - { - "token": "[your_bot_token_here]" - } - """, e); + throw new IOException("config.json was not found, did you forget to create it?", e); } }