From 92f2cf7d0b05af98b9c9fc7708004f39cad2e89e Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+studip@gmail.com>
Date: Tue, 18 Apr 2023 07:54:33 +0000
Subject: [PATCH] log errors in jsonapi as well, fixes #614

Closes #614

Merge request studip/studip!1720
---
 lib/classes/JsonApi/Errors/ErrorHandler.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/classes/JsonApi/Errors/ErrorHandler.php b/lib/classes/JsonApi/Errors/ErrorHandler.php
index 04224debfaf..eed747be53b 100644
--- a/lib/classes/JsonApi/Errors/ErrorHandler.php
+++ b/lib/classes/JsonApi/Errors/ErrorHandler.php
@@ -40,6 +40,10 @@ class ErrorHandler
 
         $code = $this->determineStatusCode($exception, $request->getMethod());
 
+        if ($code >= 500) {
+            error_log($exception);
+        }
+
         return $response->withStatus($code);
     }
 
-- 
GitLab