Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docker/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ COPY docker/app/entrypoint.sh /

COPY --from=composer-builder /composer/vendor /var/www/html/vendor

# patch exception handling from Symfony to actually show exceptions instead of swallowing them
COPY docker/app/symfony-exceptions.patch /
RUN patch -p4 -i /symfony-exceptions.patch

RUN echo "${BUILD_VERSION}" > /var/www/html/build-version.txt \
&& sed -i /var/www/html/version.php -e "s/^\\(define('VERSION', '\\).*;\$/\\1${BUILD_VERSION}'\\);/"

Expand Down
1 change: 1 addition & 0 deletions docker/app/customizations.php.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
memory_limit = 256M
post_max_size = 60M
upload_max_filesize = 60M
xdebug.log_level = 0
85 changes: 85 additions & 0 deletions docker/app/symfony-exceptions.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
--- a/var/www/html/vendor/symfony/debug/ExceptionHandler.php 2019-07-23 15:39:19.000000000 +0700
+++ b/var/www/html/vendor/symfony/debug/ExceptionHandler.php 2021-09-27 15:08:37.000000000 +0700
@@ -103,7 +103,7 @@
* The latter takes precedence and any output from the former is cancelled,
* if and only if nothing bad happens in this handling path.
*/
- public function handle(\Exception $exception)
+ public function handle(\Error $exception)
{
if (null === $this->handler || $exception instanceof OutOfMemoryException) {
$this->sendPhpResponse($exception);
@@ -144,7 +144,7 @@
try {
\call_user_func($this->handler, $exception);
$this->caughtLength = $caughtLength;
- } catch (\Exception $e) {
+ } catch (\Error $e) {
if (!$caughtLength) {
// All handlers failed. Let PHP handle that now.
throw $exception;
@@ -158,7 +158,7 @@
* This method uses plain PHP functions like header() and echo to output
* the response.
*
- * @param \Exception|FlattenException $exception An \Exception or FlattenException instance
+ * @param \Error|FlattenException $exception An \Error or FlattenException instance
*/
public function sendPhpResponse($exception)
{
@@ -180,7 +180,7 @@
/**
* Gets the full HTML content associated with the given exception.
*
- * @param \Exception|FlattenException $exception An \Exception or FlattenException instance
+ * @param \Error|FlattenException $exception An \Error or FlattenException instance
*
* @return string The HTML content as a string
*/
@@ -250,7 +250,7 @@

$content .= "</tbody>\n</table>\n</div>\n";
}
- } catch (\Exception $e) {
+ } catch (\Error $e) {
// something nasty happened and we cannot throw an exception anymore
if ($this->debug) {
$title = sprintf('Exception thrown when handling an exception (%s: %s)', \get_class($e), $this->escapeHtml($e->getMessage()));
@@ -390,7 +390,7 @@
} else {
try {
$link = $fmt->format($path, $line);
- } catch (\Exception $e) {
+ } catch (\Error $e) {
return sprintf('<span class="block trace-file-path">in <span title="%s%3$s"><strong>%s</strong>%s</span></span>', $this->escapeHtml($path), $file, 0 < $line ? ' line '.$line : '');
}
}
--- a/var/www/html/vendor/symfony/debug/Exception/FlattenException.php 2019-07-23 15:39:19.000000000 +0700
+++ b/var/www/html/vendor/symfony/debug/Exception/FlattenException.php 2021-09-27 15:09:06.000000000 +0700
@@ -33,7 +33,7 @@
private $file;
private $line;

- public static function create(\Exception $exception, $statusCode = null, array $headers = [])
+ public static function create(\Error $exception, $statusCode = null, array $headers = [])
{
$e = new static();
$e->setMessage($exception->getMessage());
@@ -59,7 +59,7 @@

$previous = $exception->getPrevious();

- if ($previous instanceof \Exception) {
+ if ($previous instanceof \Error) {
$e->setPrevious(static::create($previous));
} elseif ($previous instanceof \Throwable) {
$e->setPrevious(static::create(new FatalThrowableError($previous)));
@@ -178,7 +178,7 @@
return $this->trace;
}

- public function setTraceFromException(\Exception $exception)
+ public function setTraceFromException(\Error $exception)
{
$this->setTrace($exception->getTrace(), $exception->getFile(), $exception->getLine());
}
Loading