From 812c0552e8d9cca47f580970d4af4b202fde44cb Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Fri, 28 Aug 2020 13:57:12 -0600 Subject: [PATCH] Avoid logging SystemExceptions twice SystemExceptions are already logged when the System ServiceProvider listens to the Message Logged event, this code used to be for ApplicationExceptions to bypass the fact that they were explicitly ignored by October's core exception handler. ApplicationExceptions were added 27 Jan 2015 in https://github.com/octobercms/library/commit/6a6803626004afc9a5a0b9f0d6b4561d265c99b9 ApplicationExceptions were explicitly ignored in the core exception handler on 16 Feb 2015 in https://github.com/octobercms/library/commit/237d97d87a18fa8eced1d88d9bc5aefeded3ee8d#diff-b6bf0348130fdd1311473a97536310cdR20 and were explicitly logged in the System exception handler on the same day in https://github.com/octobercms/october/commit/7b52e07b6533dbf9a52b17ba3427b83dbb3cf0d3#diff-547f5794a63e9f138c33b20de8649b7eR20-R31 Not sure why that was originally the case, but we've made the decision that ApplicationExceptions shouldn't be logged by default as they should occur semi-regularly in a healthy application (mostly as an expression of complex logical validation that triggers them based on bad user input): https://github.com/octobercms/october/pull/4569#issuecomment-550172508 Fixes octobercms/october#5253. --- modules/system/classes/ErrorHandler.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/modules/system/classes/ErrorHandler.php b/modules/system/classes/ErrorHandler.php index 4a5836f05..ec5524946 100644 --- a/modules/system/classes/ErrorHandler.php +++ b/modules/system/classes/ErrorHandler.php @@ -1,6 +1,5 @@ getContent(); }