Popularity
8.2
Growing
Activity
3.6
-
61
9
5
Programming language: HTML
License: MIT License
Tags:
Framework Components
Latest version: v0.1.4
Exception Page alternatives and similar shards
Based on the "Framework Components" category.
Alternatively, view Exception Page alternatives based on common mentions on social networks and blogs.
-
shrine.cr
File Attachment toolkit for Crystal applications. Heavily inspired by Shrine for Ruby. -
artanis
Sinatra-like DSL for the Crystal language (abusing macros) -
praetorian
A minimalist Crystal authorization system inspired by https://github.com/varvet/pundit. -
motion.cr
Motion is a framework for building reactive, real-time frontend UI components in your Amber application using pure Crystal that are reusable, testable & encapsulated. -
kemal-auth-token
Kemal middleware to authentication via HTTP header token using JWT -
device_detector
Crystal shard for device detection by User-Agent string -
mochi
Mochi is a authentication shard inspired by devise. Mochi is designed for the Amber framework with support for both Granite & Jennifer ORM's. -
Athena Event Dispatcher
A Mediator and Observer pattern event library -
mime-types.cr
MIME Types for Crystal :: A port of the Ruby MIME::Types library -
request_id
Middleware for generates / pick up a unique request ID for Crystal servers. -
Athena Negotiation
Framework agnostic content negotiation library
Less time debugging, more time building
Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.
Promo
scoutapm.com
Do you think we are missing an alternative of Exception Page or a related project?
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.for_runtime_exception(context, e).to_s
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!