Run error_log before sending error mail

This commit is contained in:
jrenslin committed 2021-09-15 10:46:26 +02:00
1 parent 2fd7511218
commit 8394bf54b9
1 file changed
+7 -2
+7 -2
View File
@@ -222,6 +222,13 @@ public function sendDebugMail(string $to, string $subject = "", string $descript
*/
public function sendErrorReport(Throwable $exception, string $recipient, string $addDesc = ""):void {
// First, write the error to the general error log. This should happen first,
// so that it will also work if there is a problem retrieving GPG keys.
\error_log((string)$exception);
// Second, a mail is generated and sent.
$subject = \get_class($exception) . ": " . $exception->getCode();
$description = $addDesc;
@@ -238,8 +245,6 @@ public function sendErrorReport(Throwable $exception, string $recipient, string
$additionalContextInfo
);
\error_log((string)$exception);
}
/**