Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/API/Renderer/Original.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/API/Renderer/Original.php b/plugins/API/Renderer/Original.php
index 96895b8012..ca33e4e81b 100644
--- a/plugins/API/Renderer/Original.php
+++ b/plugins/API/Renderer/Original.php
@@ -22,10 +22,17 @@ class Original extends ApiRenderer
* @param $message
* @param \Exception|\Throwable $exception
* @throws \Exception|\Throwable
- * @return void
+ * @return string
*/
public function renderException($message, $exception)
{
+ if ($this->shouldSerialize()) {
+ return serialize([
+ 'result' => 'error',
+ 'message' => $message,
+ ]);
+ }
+
throw $exception;
}