]> git.mxchange.org Git - friendica.git/blobdiff - src/BaseModule.php
Add previous exception to unexpected worker exception logging
[friendica.git] / src / BaseModule.php
index 12efbce81170b476918e9a922453f37aa179db24..11f884472e65c448c774d6b8f1576ef986903bac 100644 (file)
@@ -243,6 +243,14 @@ abstract class BaseModule implements ICanHandleRequests
                        $this->response->addContent($arr['content']);
                        $this->response->addContent($this->content($request));
                } catch (HTTPException $e) {
+                       // In case of System::externalRedirects(), we don't want to prettyprint the exception
+                       // just redirect to the new location
+                       if (($e instanceof HTTPException\FoundException) ||
+                               ($e instanceof HTTPException\MovedPermanentlyException) ||
+                               ($e instanceof HTTPException\TemporaryRedirectException)) {
+                               throw $e;
+                       }
+
                        $this->response->addContent($httpException->content($e));
                } finally {
                        $this->profiler->set(microtime(true) - $timestamp, 'content');