From 779144da3cb3503044a0d2cb4d11437abfe2721c Mon Sep 17 00:00:00 2001 From: Marc Scholten Date: Tue, 12 Mar 2024 10:58:18 +0100 Subject: [PATCH] Only track exception (e.g. with sentry) in production This was the expected behaviour, but turns out I missed one place --- IHP/ErrorController.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/IHP/ErrorController.hs b/IHP/ErrorController.hs index a468d0bcc..3ff0f5a80 100644 --- a/IHP/ErrorController.hs +++ b/IHP/ErrorController.hs @@ -78,11 +78,12 @@ displayException exception action additionalInfo = do -- to the error tracking service (e.g. sentry). Usually this service also writes -- the error message to the stderr output -- - let exceptionTracker = ?applicationContext.frameworkConfig.exceptionTracker.onException - let request = ?requestContext.request + when (?context.frameworkConfig.environment == Environment.Production) do + let exceptionTracker = ?applicationContext.frameworkConfig.exceptionTracker.onException + let request = ?requestContext.request - exceptionTracker (Just request) exception + exceptionTracker (Just request) exception supportingHandlers |> head