exception_page
Version, currently 0.5.014 versions
- 0.5.0latestOct 13, 2024
- 0.4.1not indexedMar 15, 2025
- 0.4.0not indexedMar 15, 2025
- 0.3.1not indexedMar 15, 2025
- 0.3.0not indexedMar 15, 2025
- 0.2.2not indexedMar 15, 2025
- 0.2.1not indexedMar 15, 2025
- 0.2.0not indexedMar 15, 2025
- 0.1.5not indexedMar 15, 2025
- 0.1.4not indexedMar 15, 2025
- 0.1.3not indexedMar 15, 2025
- 0.1.2not indexedMar 15, 2025
- 0.1.1not indexedMar 15, 2025
- 0.1.0not indexedMar 15, 2025
github.com/crystal-loot/exception_page
An exceptional exception page for Crystal web libraries and frameworks
72 stars
15 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
exception_page:
github: crystal-loot/exception_page
version: ~> 0.5.0Then run:
shards installshard.yml
- Crystal
>= 1.8.0- License
- MIT
- Authors
- Paul Smith, Faustino Aguilar, Sijawusz Pur Rahnama
Dependencies
Runtime Dependencies
- backtracer~> 1.2.2github: Sija/backtracer.cr
Development Dependencies
- ameba~> 1.5.0github: crystal-ameba/amebadev
- lucky_flow~> 0.10.0github: luckyframework/lucky_flowdev
README
Exception Page 
A library for displaying exceptional exception pages for easier debugging.

Installation
Add this to your application's shard.yml:
dependencies:
exception_page:
github: crystal-loot/exception_page
Usage
Require the shard:
require "exception_page"
Create an exception page:
class MyApp::ExceptionPage < ExceptionPage
def styles : Styles
ExceptionPage::Styles.new(
accent: "purple", # Choose the HTML color value. Can be hex
)
end
end
Render the HTML when an exception occurs:
class MyErrorHandler
include HTTP::Handler
def call_next(context)
begin
# Normally you'd call some code to handle the request
# We're hard-coding an error here to show you how to use the lib.
raise SomeError.new("Something went wrong")
rescue e
context.response.status_code = 500
context.response.print MyApp::ExceptionPage.new context, e
end
end
Customizing the page
class MyApp::ExceptionPage < ExceptionPage
def styles : Styles
ExceptionPage::Styles.new(
accent: "purple", # Required
highlight: "gray", # Optional
flash_highlight: "red", # Optional
logo_uri: "base64_encoded_data_uri" # Optional. Defaults to Crystal logo. Generate a logo here: https://dopiaza.org/tools/datauri/index.php
)
end
# Optional. If provided, clicking the logo will open this page
def project_url
"https://myproject.com"
end
# Optional
def stack_trace_heading_html
<<-HTML
<a href="#" onclick="sayHi()">Say hi</a>
HTML
end
# Optional
def extra_javascript
<<-JAVASCRIPT
window.sayHi = function() {
alert("Say Hi!");
}
JAVASCRIPT
end
end
Development
TODO: Write development instructions here
Contributing
- Fork it (https://github.com/crystal-loot/exception_page/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- @paulcsmith Paul Smith
- @faustinoaq Faustino Aigular - Wrote the initial Amber PR adding exception pages
- @Sija Sijawusz Pur Rahnama
Special Thanks
This exception page is heavily based on the Phoenix error page by @rstacruz. Thanks to the Phoenix team and @rstacruz!
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.5.0- Tagged
- Oct 13, 2024
- Commit
c8c83bc2d3a3- Crystal
>= 1.8.0- Indexed
- yes
Dependents
and 3 more
Repository
github.com/crystal-loot/exception_page
Metadata
- Created
- Aug 12, 2026
- Updated
- Sep 4, 2026
- Synced
- Sep 4, 2026
- Versions
- 14