{"id":41784196,"url":"https://github.com/mwat56/errorhandler","last_synced_at":"2026-01-25T04:08:09.200Z","repository":{"id":57491070,"uuid":"184624822","full_name":"mwat56/errorhandler","owner":"mwat56","description":"A provider of customised error pages for Go web-server HTTP errors","archived":false,"fork":false,"pushed_at":"2025-03-24T17:00:40.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T18:21:38.675Z","etag":null,"topics":["error-page","golang","golang-package","middleware","website"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mwat56.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-05-02T17:41:49.000Z","updated_at":"2025-03-24T17:00:43.000Z","dependencies_parsed_at":"2025-03-24T18:21:27.911Z","dependency_job_id":"55b893fd-2721-47e2-beb5-d6e45d571f94","html_url":"https://github.com/mwat56/errorhandler","commit_stats":null,"previous_names":["mwat56/go-errorhandler"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/mwat56/errorhandler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwat56%2Ferrorhandler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwat56%2Ferrorhandler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwat56%2Ferrorhandler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwat56%2Ferrorhandler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mwat56","download_url":"https://codeload.github.com/mwat56/errorhandler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwat56%2Ferrorhandler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28742983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T02:46:29.005Z","status":"ssl_error","status_checked_at":"2026-01-25T02:44:29.968Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["error-page","golang","golang-package","middleware","website"],"created_at":"2026-01-25T04:08:09.151Z","updated_at":"2026-01-25T04:08:09.195Z","avatar_url":"https://github.com/mwat56.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ErrorHandler\n\n[![Golang](https://img.shields.io/badge/Language-Go-green.svg)](https://golang.org/)\n[![GoDoc](https://godoc.org/github.com/mwat56/errorhandler?status.svg)](https://godoc.org/github.com/mwat56/errorhandler/)\n[![Go Report](https://goreportcard.com/badge/github.com/mwat56/errorhandler)](https://goreportcard.com/report/github.com/mwat56/errorhandler)\n[![Issues](https://img.shields.io/github/issues/mwat56/errorhandler.svg)](https://github.com/mwat56/errorhandler/issues?q=is%3Aopen+is%3Aissue)\n[![Size](https://img.shields.io/github/repo-size/mwat56/errorhandler.svg)](https://github.com/mwat56/errorhandler/)\n[![Tag](https://img.shields.io/github/tag/mwat56/errorhandler.svg)](https://github.com/mwat56/errorhandler/tags)\n[![License](https://img.shields.io/github/license/mwat56/errorhandler.svg)](https://github.com/mwat56/errorhandler/blob/main/LICENSE)\n[![View examples](https://img.shields.io/badge/learn%20by-examples-0077b3.svg)](https://github.com/mwat56/errorhandler/blob/main/cmd/demo.go)\n\n- [ErrorHandler](#errorhandler)\n\t- [Purpose](#purpose)\n\t- [Installation](#installation)\n\t- [Usage](#usage)\n\t- [Libraries](#libraries)\n\t- [Licence](#licence)\n\n----\n\n## Purpose\n\nThe out-of-the-box `Go` web-server send _plain text error messages_ whenever an `HTTP` error occurs.\nThis middleware package provides a simple facility to send whatever `HTML` page you like for error-pages.\n\n## Installation\n\nYou can use `Go` to install this package for you:\n\n    go get -u github.com/mwat56/errorhandler\n\n## Usage\n\nThis package defines the `TErrorPager` interface which requires just one method:\n\n    TErrorPager interface {\n        // GetErrorPage returns an error page for `aStatus`.\n        //\n        // `aData` is the original error text.\n        //\n        // `aStatus` is the error number of the actual HTTP error.\n        GetErrorPage(aData []byte, aStatus int) []byte\n    }\n\nIf the method's return value is _empty_ then `aData` is sent _as is_ to the remote user, otherwise the method's result is sent thus delighting your users with your customised page.\n\nOnce you've implemented such a method you call the package's `Wrap()` function:\n\n    Wrap(aHandler http.Handler, aPager TErrorPager) http.Handler\n\nThe arguments are:\n\n* `aHandler` is your original HTTP handler which will be wrapped by this package (and used internally).\n\n* `aPager` is the provider of error message pages as discussed above.\n\nIn the sub-directory `./cmd` there is the file `demo.go` which shows the bare minimum of how to integrate this package with your web-server.\n\n## Libraries\n\nNo external libraries were used building `ErrorHandler`.\n\n## Licence\n\n    Copyright © 2019, 2025 M.Watermann, 10247 Berlin, Germany\n                    All rights reserved\n                EMail : \u003csupport@mwat.de\u003e\n\n\u003e This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.\n\u003e\n\u003e This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\u003e\n\u003e You should have received a copy of the GNU General Public License along with this program. If not, see the [GNU General Public License](http://www.gnu.org/licenses/gpl.html) for details.\n\n----\n[![GFDL](https://www.gnu.org/graphics/gfdl-logo-tiny.png)](http://www.gnu.org/copyleft/fdl.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwat56%2Ferrorhandler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmwat56%2Ferrorhandler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwat56%2Ferrorhandler/lists"}