fix(ExceptionSerializer): encode arguments before filtering the trace

This will avoid running into a Nesting level too deep error as the
encodeArg calls will limit potential recursive calls on the arguments to
a nesting level of 5

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2023-01-03 19:24:00 +01:00
parent e056dd8ba9
commit 41cc0bb190
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF

View file

@ -223,13 +223,13 @@ class ExceptionSerializer {
}
private function encodeTrace($trace) {
$filteredTrace = $this->filterTrace($trace);
return array_map(function (array $line) {
$trace = array_map(function (array $line) {
if (isset($line['args'])) {
$line['args'] = array_map([$this, 'encodeArg'], $line['args']);
}
return $line;
}, $filteredTrace);
}, $trace);
return $this->filterTrace($trace);
}
private function encodeArg($arg, $nestingLevel = 5) {