Skip to content

feat(astro): add HTTP error pages with shared ErrorPage component - #68

Merged
chris-c-thomas merged 2 commits into
mainfrom
feat/http-error-pages
Mar 23, 2026
Merged

feat(astro): add HTTP error pages with shared ErrorPage component#68
chris-c-thomas merged 2 commits into
mainfrom
feat/http-error-pages

Conversation

@chris-c-thomas

Copy link
Copy Markdown
Owner

Create a reusable ErrorPage.astro component

Implement styled error pages for all relevant HTTP status codes.

Refactor the existing 404 page to use the shared component.

Pages created:

  • 400 Bad Request
  • 403 Forbidden
  • 404 Not Found (refactored)
  • 405 Method Not Allowed
  • 410 Gone
  • 429 Too Many Requests
  • 451 Unavailable for Legal Reasons
  • 500 Internal Server Error
  • 502 Bad Gateway
  • 503 Service Unavailable
  • 504 Gateway Timeout

  Create a reusable ErrorPage.astro component

  Implement styled error pages for all relevant HTTP status codes.

  Refactor the existing 404 page to use the shared component.

  Pages created:
  - 400 Bad Request
  - 403 Forbidden
  - 404 Not Found (refactored)
  - 405 Method Not Allowed
  - 410 Gone
  - 429 Too Many Requests
  - 451 Unavailable for Legal Reasons
  - 500 Internal Server Error
  - 502 Bad Gateway
  - 503 Service Unavailable
  - 504 Gateway Timeout
@chris-c-thomas
chris-c-thomas requested a review from Copilot March 23, 2026 18:43
@chris-c-thomas chris-c-thomas self-assigned this Mar 23, 2026
@chris-c-thomas chris-c-thomas added enhancement Enhancements made to exisiting features or codebase feature New feature implemented main astro labels Mar 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a shared error-page component to the Astro SSR app and introduces dedicated routes for common HTTP error codes, refactoring the existing 404 page to use the shared UI.

Changes:

  • Added a reusable ErrorPage.astro component for consistent error-page layout.
  • Added new status-code pages (400, 403, 405, 410, 429, 451, 500, 502, 503, 504) and refactored 404.astro to use the shared component.
  • Included an SSR-focused note in 500.astro about keeping imports minimal for the error boundary page.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/astro/src/components/ErrorPage.astro New shared component used by all error pages.
apps/astro/src/pages/400.astro New 400 error page using ErrorPage.
apps/astro/src/pages/403.astro New 403 error page using ErrorPage.
apps/astro/src/pages/404.astro Refactors 404 page to use ErrorPage.
apps/astro/src/pages/405.astro New 405 error page using ErrorPage.
apps/astro/src/pages/410.astro New 410 error page using ErrorPage.
apps/astro/src/pages/429.astro New 429 error page using ErrorPage.
apps/astro/src/pages/451.astro New 451 error page using ErrorPage.
apps/astro/src/pages/500.astro New 500 error page using ErrorPage with SSR boundary note.
apps/astro/src/pages/502.astro New 502 error page using ErrorPage.
apps/astro/src/pages/503.astro New 503 error page using ErrorPage.
apps/astro/src/pages/504.astro New 504 error page using ErrorPage.

Comment thread apps/astro/src/components/ErrorPage.astro Outdated
Comment thread apps/astro/src/pages/500.astro Outdated
@chris-c-thomas
chris-c-thomas merged commit 4bf3204 into main Mar 23, 2026
5 checks passed
@sonarqubecloud

Copy link
Copy Markdown

@chris-c-thomas
chris-c-thomas deleted the feat/http-error-pages branch March 31, 2026 00:59
@chris-c-thomas
chris-c-thomas restored the feat/http-error-pages branch March 31, 2026 00:59
@chris-c-thomas
chris-c-thomas deleted the feat/http-error-pages branch April 13, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astro enhancement Enhancements made to exisiting features or codebase feature New feature implemented main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants