From 2f0b817d5d79bb7aafa496374401c3c73e829006 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 6 Nov 2022 12:31:03 +0700 Subject: [PATCH] Include entry name in error message --- .../dbotthepony/mc/otm/matter/MatterManager.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt index c984c7e55..24d8269ce 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt @@ -233,10 +233,10 @@ object MatterManager : SimpleJsonResourceReloadListener(GsonBuilder().setPrettyP } override fun update(registry: MutableCollection, modifier: ResourceLocation) { - checkNotNull(matter) { "Missing matter value, which is required for insert action" } - checkNotNull(complexity) { "Missing complexity value, which is required for insert action" } + checkNotNull(matter) { "Missing matter value, which is required for insert action (for $modifier)" } + checkNotNull(complexity) { "Missing complexity value, which is required for insert action (for $modifier)" } - check(!comparePriority || priority != null) { "If compare_priority is true then priority must not be null" } + check(!comparePriority || priority != null) { "If compare_priority is true then priority must not be null (for $modifier)" } if (!checkConditions()) { return @@ -330,8 +330,8 @@ object MatterManager : SimpleJsonResourceReloadListener(GsonBuilder().setPrettyP return } - check(matter == null) { "Delete action can't have matter value" } - check(complexity == null) { "Delete action can't have complexity value" } + check(matter == null) { "Delete action can't have matter value (for $modifier)" } + check(complexity == null) { "Delete action can't have complexity value (for $modifier)" } if (key != null) { val iterator = registry.iterator() @@ -600,19 +600,19 @@ object MatterManager : SimpleJsonResourceReloadListener(GsonBuilder().setPrettyP complexityFunctions.isNotEmpty() || priorityFunctions.isNotEmpty() )) { - throw JsonParseException("Can't update existing entries without anything specified") + throw JsonParseException("Can't update existing entries without anything specified (for $modifier)") } if (matter != null && matterFunctions.isNotEmpty()) { - throw JsonParseException("Can't have both matter and matter functions specified at the same time") + throw JsonParseException("Can't have both matter and matter functions specified at the same time (for $modifier)") } if (complexity != null && complexityFunctions.isNotEmpty()) { - throw JsonParseException("Can't have both complexity and complexity functions specified at the same time") + throw JsonParseException("Can't have both complexity and complexity functions specified at the same time (for $modifier)") } if (priority != null && priorityFunctions.isNotEmpty()) { - throw JsonParseException("Can't have both priority and priority functions specified at the same time") + throw JsonParseException("Can't have both priority and priority functions specified at the same time (for $modifier)") } if (!checkConditions()) {