From 7e3927cb72867208cdeaedfc887b0dcdc8209a12 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Wed, 24 Apr 2024 16:51:02 +0300 Subject: [PATCH] Improving validation error messages --- bhl.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bhl.inc.php b/bhl.inc.php index 148c7d7..7a0b9d6 100644 --- a/bhl.inc.php +++ b/bhl.inc.php @@ -286,7 +286,7 @@ function bhl_validate_func_ref(string $module_file, string $func_full_name, arra { $module_chunks = preg_split('~namespace\s+'.preg_quote($namespace).'\s*{~', $module_src); if(count($module_chunks) < 2) - throw new Exception("Namespace '$namespace' not found in '$module_file'"); + throw new Exception("Namespace '$namespace' for func '$func_full_name' not found in '$module_file'"); $module_chunks = array_filter($module_chunks, function($item) { return strlen($item) > 0;}); } else @@ -319,7 +319,7 @@ function bhl_validate_func_ref(string $module_file, string $func_full_name, arra return; } - throw new Exception("Func '$func' signature '".implode(',', $signature)."' not found in module '$module_file'"); + throw new Exception("Func '$func_full_name(".implode(',', $signature).")' not found in '$module_file'"); } function bhl_upm_path() : string