From ac73ab9021985e0fc44bcdaf8cafd201132d6bbd Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 18 Oct 2022 21:39:40 +0200 Subject: [PATCH] MVC - prevent UserExceptions to end up in the crash reporter. closes https://github.com/opnsense/core/issues/6098 --- src/opnsense/www/api.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/opnsense/www/api.php b/src/opnsense/www/api.php index c32232dd3..09044990d 100644 --- a/src/opnsense/www/api.php +++ b/src/opnsense/www/api.php @@ -23,7 +23,9 @@ try { echo $application->handle($_SERVER['REQUEST_URI'])->getContent(); } catch (\Error | \Exception $e) { - error_log($e); + if (!is_a($e, 'OPNsense\Base\UserException')) { + error_log($e); + } $response = [ 'errorMessage' => $e->getMessage(),