From 5f190ba003a460d2c5f7fcaa2525206cc9bec784 Mon Sep 17 00:00:00 2001 From: Osahenrumwen Aigbogun Date: Tue, 19 Nov 2024 16:06:25 +0100 Subject: [PATCH] Update to CoreException --- src/Core/CoreException.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Core/CoreException.php b/src/Core/CoreException.php index ffeedcc..fc8c4c7 100644 --- a/src/Core/CoreException.php +++ b/src/Core/CoreException.php @@ -215,6 +215,7 @@ private function container(?string $title, ?string $body, array $other = []): ar } $env = $this->get_env(); + $this->always_log = $env == "PRODUCTION" ? true : $this->always_log; $return_as_string = $other['as_string'] ?: false; $echo_error = $other['echo_error'] ?? true; $display_error = $env == "DEVELOPMENT" || $other['core'] == "view"; @@ -410,7 +411,7 @@ private function container(?string $title, ?string $body, array $other = []): ar $rtn = [ "act" => $other['act'] ?? "allow", - "error" => $error ?? (@$display ?: ($write ? "Check logs for details. Error encountered" : "Error encountered, but could not write to log file due to insufficient permission!")), + "error" => $error ?? (@$display ?: ($this->always_log ? "Check logs for details. Error encountered" : "Error encountered, but was not logged")), "as_string" => $return_as_string, "display_error" => $display_error, "echo_error" => $echo_error,