fix: add parent function name in setValue exception (#2777)

* fix: add parent function name in setValue exception

* style: fmt
This commit is contained in:
Jonas L 2023-11-13 19:46:47 +01:00 committed by GitHub
parent 23e4973183
commit c764a5a648
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -63,8 +63,10 @@ class Application_Model_Preference
$paramMap = []; $paramMap = [];
if ($result > 1) { if ($result > 1) {
// this case should not happen. // this case should not happen.
$caller = debug_backtrace()[1]['function'];
throw new Exception('Invalid number of results returned. Should be ' . throw new Exception('Invalid number of results returned. Should be ' .
"0 or 1, but is '{$result}' instead"); "0 or 1, but is '{$result}' instead, caller={$caller}");
} }
if ($result == 1) { if ($result == 1) {
// result found // result found