diff --git a/app/controllers/general.php b/app/controllers/general.php index dc026f238c..03f53b9582 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -74,7 +74,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw ]) )[0] ?? new Document(); } - + $errorView = __DIR__ . '/../views/general/error.phtml'; $url = (System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https') . '://' . System::getEnv('_APP_DOMAIN', ''); @@ -535,7 +535,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw } } } - + // Branded error pages (when developer left body empty) if ($executionResponse['statusCode'] >= 400 && empty($executionResponse['body'])) { $layout = new View($errorView); @@ -1304,9 +1304,9 @@ App::error() ->setStatusCode($code); $template = $error->getView() ?? (($route) ? $route->getLabel('error', null) : null); - + // TODO: Ideally use group 'api' here, but all wildcard routes seem to have 'api' at the moment - if(!\str_starts_with($route->getPath(), '/v1')) { + if (!\str_starts_with($route->getPath(), '/v1')) { $template = __DIR__ . '/../views/general/error.phtml'; } diff --git a/app/views/general/error.phtml b/app/views/general/error.phtml index 1f071b3299..48133087fd 100644 --- a/app/views/general/error.phtml +++ b/app/views/general/error.phtml @@ -240,7 +240,7 @@ switch ($type) { } .error-trace { - max-width: 800px; + max-width: 900px; padding: 20px; font-family: var(--font-family-sansSerif, Inter), sans-serif; } @@ -374,8 +374,35 @@ switch ($type) { .type { background: var(--color-overlay-on-neutral, rgba(25, 25, 28, 1)); color: var(--color-fgColor-neutral-secondary, #C3C3C6); + border: var(--border-width-S, 1px) solid var(--color-border-neutral-strong, #414146); + } + + .back-button { + color: var(--color-fgColor-neutral-secondary, #C3C3C6); + } + + .trace-grid { + background: var(--color-bgColor-neutral-secondary, #1D1D21); border: var(--border-width-S, 1px) solid var(--color-border-neutral-strong, #2D2D31); } + + .trace-grid-header { + background: var(--color-bgColor-neutral-secondary, #19191C); + border: var(--border-width-S, 1px) solid var(--color-border-neutral-strong, #2D2D31); + color: var(--color-fgColor-neutral-secondary, #C3C3C6); + } + + .trace-label { + color: var(--color-fgColor-neutral-secondary, #C3C3C6); + } + + .trace-value { + color: var(--color-fgColor-neutral-secondary, #C3C3C6); + } + + .trace-args { + color: var(--color-fgColor-neutral-secondary, #C3C3C6); + } } diff --git a/tests/e2e/Services/Sites/SitesCustomServerTest.php b/tests/e2e/Services/Sites/SitesCustomServerTest.php index db61767ffa..df6abfc833 100644 --- a/tests/e2e/Services/Sites/SitesCustomServerTest.php +++ b/tests/e2e/Services/Sites/SitesCustomServerTest.php @@ -2612,10 +2612,10 @@ class SitesCustomServerTest extends Scope ]); $this->assertEquals(400, $response['headers']['status-code']); $this->assertStringContainsString("Deployment build failed", $response['body']); - + $this->cleanupSite($siteId); } - + public function testEmptySiteSource(): void { $siteId = $this->setupSite([ @@ -2707,7 +2707,7 @@ class SitesCustomServerTest extends Scope $this->assertEquals('failed', $deployment['body']['status'], 'Deployment status does not match: ' . json_encode($deployment['body'], JSON_PRETTY_PRINT)); $this->assertStringContainsString('Error:', $deployment['body']['buildLogs'], 'Deployment logs do not match: ' . json_encode($deployment['body'], JSON_PRETTY_PRINT)); }, 100000, 500); - + $this->cleanupSite($siteId); } }