From 32c88386f35587d6af9f3ee1870e568ad497334d Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Sun, 5 May 2024 20:13:45 +0200 Subject: [PATCH] Improved error reporting on incorrect arguments --- errors.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/errors.lua b/errors.lua index 8dad2e2..2484649 100644 --- a/errors.lua +++ b/errors.lua @@ -86,10 +86,10 @@ local function correct_error (self, module_suffix, format_msg, gotten_string, po assert(type(module_suffix) == 'string') format_msg = format_msg or DEFAULT_ERROR_MSG_CORRECT lvl = lvl or 0 - assert(type(format_msg) == 'string') - assert(type(gotten_string) == 'string') - assert(type(possible_strings) == 'table') - assert(type(lvl) == 'number') + assert(type(format_msg) == 'string', 'Internal errors error: incorrect type for argument format_msg') + assert(type(gotten_string) == 'string', 'Internal errors error: incorrect type for argument gotten_string') + assert(type(possible_strings) == 'table', 'Internal errors error: incorrect type for argument possible_strings') + assert(type(lvl) == 'number', 'Internal errors error: incorrect type for argument lvl') -- Do stuff possible_strings = string_dist.strings_with_highest_similarity(gotten_string, possible_strings)