From 48d67329f579b311c25df9352922e83d4f6dc6f5 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Tue, 12 Mar 2024 19:16:04 +0300 Subject: [PATCH] Improving exception message --- src/codegen.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegen.inc.php b/src/codegen.inc.php index 59b345a..c5d7e5a 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -209,7 +209,7 @@ function data2value($name, \mtgType $type, $buf, $prefix = '', $tokens = array() if(array_key_exists('virtual', $tokens)) { $str .= $cond_indent."\$vclass__ = AutogenBundle::getClassName(\metagen_php\\val_uint32(\metagen_php\array_extract_val(\$tmp_sub_arr__, \$assoc, '\$id', {$type->getClassId()})));\n"; - $str .= $cond_indent."if(!is_subclass_of(\$vclass__, '{$type->getName()}')) throw new Exception(\$vclass__ . ' is not subclass of {$type->getName()}');\n"; + $str .= $cond_indent."if(!is_subclass_of(\$vclass__, '{$type->getName()}')) throw new Exception(\"'\$vclass__' is not subclass of '{$type->getName()}'\");\n"; $str .= $cond_indent."{$pname} = new \$vclass__(\$tmp_sub_arr__, \$assoc);\n"; } else