{"id":13483259,"url":"https://github.com/crystal-loot/exception_page","last_synced_at":"2025-04-09T13:10:09.171Z","repository":{"id":41976879,"uuid":"139151610","full_name":"crystal-loot/exception_page","owner":"crystal-loot","description":"An exceptional exception page for Crystal web libraries and frameworks","archived":false,"fork":false,"pushed_at":"2025-03-15T21:07:24.000Z","size":103,"stargazers_count":64,"open_issues_count":1,"forks_count":9,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-02T08:47:59.587Z","etag":null,"topics":["crystal","hacktoberfest","web"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crystal-loot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-29T13:16:27.000Z","updated_at":"2025-03-15T21:07:28.000Z","dependencies_parsed_at":"2024-07-15T20:41:31.564Z","dependency_job_id":"abad2d3e-fa0c-423f-9915-103af30f2d31","html_url":"https://github.com/crystal-loot/exception_page","commit_stats":{"total_commits":47,"total_committers":8,"mean_commits":5.875,"dds":0.6595744680851063,"last_synced_commit":"c8c83bc2d3a39709f58e51919d882e718a8ce8b6"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-loot%2Fexception_page","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-loot%2Fexception_page/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-loot%2Fexception_page/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-loot%2Fexception_page/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crystal-loot","download_url":"https://codeload.github.com/crystal-loot/exception_page/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045245,"owners_count":21038554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crystal","hacktoberfest","web"],"created_at":"2024-07-31T17:01:09.466Z","updated_at":"2025-04-09T13:10:09.152Z","avatar_url":"https://github.com/crystal-loot.png","language":"HTML","funding_links":[],"categories":["Framework Components"],"sub_categories":[],"readme":"# Exception Page [![CI](https://github.com/crystal-loot/exception_page/actions/workflows/ci.yml/badge.svg)](https://github.com/crystal-loot/exception_page/actions/workflows/ci.yml)\n\nA library for displaying exceptional exception pages for easier debugging.\n\n![screen shot 2018-06-29 at 2 39 18 pm](https://user-images.githubusercontent.com/22394/42109073-6e767d06-7baa-11e8-9ec9-0a2afce605be.png)\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  exception_page:\n    github: crystal-loot/exception_page\n```\n\n## Usage\n\nRequire the shard:\n\n```crystal\nrequire \"exception_page\"\n```\n\nCreate an exception page:\n\n```crystal\nclass MyApp::ExceptionPage \u003c ExceptionPage\n  def styles : Styles\n    ExceptionPage::Styles.new(\n      accent: \"purple\", # Choose the HTML color value. Can be hex\n    )\n  end\nend\n```\n\nRender the HTML when an exception occurs:\n\n```crystal\nclass MyErrorHandler\n  include HTTP::Handler\n\n  def call_next(context)\n    begin\n      # Normally you'd call some code to handle the request\n      # We're hard-coding an error here to show you how to use the lib.\n      raise SomeError.new(\"Something went wrong\")\n    rescue e\n      context.response.status_code = 500\n      context.response.print MyApp::ExceptionPage.new context, e\n    end\n  end\n```\n\n## Customizing the page\n\n```crystal\nclass MyApp::ExceptionPage \u003c ExceptionPage\n  def styles : Styles\n    ExceptionPage::Styles.new(\n      accent: \"purple\", # Required\n      highlight: \"gray\", # Optional\n      flash_highlight: \"red\", # Optional\n      logo_uri: \"base64_encoded_data_uri\" # Optional. Defaults to Crystal logo. Generate a logo here: https://dopiaza.org/tools/datauri/index.php\n    )\n  end\n\n  # Optional. If provided, clicking the logo will open this page\n  def project_url\n    \"https://myproject.com\"\n  end\n\n  # Optional\n  def stack_trace_heading_html\n    \u003c\u003c-HTML\n    \u003ca href=\"#\" onclick=\"sayHi()\"\u003eSay hi\u003c/a\u003e\n    HTML\n  end\n\n  # Optional\n  def extra_javascript\n    \u003c\u003c-JAVASCRIPT\n    window.sayHi = function() {\n      alert(\"Say Hi!\");\n    }\n    JAVASCRIPT\n  end\nend\n```\n\n## Development\n\nTODO: Write development instructions here\n\n## Contributing\n\n1.  Fork it (\u003chttps://github.com/crystal-loot/exception_page/fork\u003e)\n2.  Create your feature branch (`git checkout -b my-new-feature`)\n3.  Commit your changes (`git commit -am 'Add some feature'`)\n4.  Push to the branch (`git push origin my-new-feature`)\n5.  Create a new Pull Request\n\n## Contributors\n\n- [@paulcsmith](https://github.com/paulcsmith) Paul Smith\n- [@faustinoaq](https://github.com/faustinoaq) Faustino Aigular - Wrote the initial [Amber PR adding exception pages](https://github.com/amberframework/amber/pull/864)\n- [@Sija](https://github.com/paulcsmith) Sijawusz Pur Rahnama\n\n## Special Thanks\n\nThis exception page is heavily based on the [Phoenix error page](https://github.com/phoenixframework/phoenix/issues/1776)\nby [@rstacruz](https://github.com/rstacruz). Thanks to the Phoenix team and @rstacruz!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystal-loot%2Fexception_page","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrystal-loot%2Fexception_page","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystal-loot%2Fexception_page/lists"}