{"id":13412752,"url":"https://github.com/emperror/emperror","last_synced_at":"2026-03-11T13:06:09.921Z","repository":{"id":57485556,"uuid":"94152209","full_name":"emperror/emperror","owner":"emperror","description":"The Emperor takes care of all errors personally","archived":false,"fork":false,"pushed_at":"2020-10-04T16:48:36.000Z","size":973,"stargazers_count":361,"open_issues_count":6,"forks_count":17,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-14T04:01:54.571Z","etag":null,"topics":["error","error-handler","error-handling","error-monitoring","error-reporting","go","golang"],"latest_commit_sha":null,"homepage":"https://emperror.dev/emperror","language":"Go","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/emperror.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-13T00:24:28.000Z","updated_at":"2025-08-11T05:02:27.000Z","dependencies_parsed_at":"2022-09-01T23:11:12.738Z","dependency_job_id":null,"html_url":"https://github.com/emperror/emperror","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/emperror/emperror","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emperror%2Femperror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emperror%2Femperror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emperror%2Femperror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emperror%2Femperror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emperror","download_url":"https://codeload.github.com/emperror/emperror/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emperror%2Femperror/sbom","scorecard":{"id":376213,"data":{"date":"2025-08-11","repo":{"name":"github.com/emperror/emperror","commit":"488c6525de31d3b472bad221769c5af58ef9e62c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/checks.yml:1","Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/checks.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/emperror/emperror/checks.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/checks.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/emperror/emperror/checks.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/checks.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/emperror/emperror/checks.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/emperror/emperror/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/emperror/emperror/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/emperror/emperror/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/emperror/emperror/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/emperror/emperror/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/emperror/emperror/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/emperror/emperror/ci.yml/master?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T14:18:44.273Z","repository_id":57485556,"created_at":"2025-08-18T14:18:44.273Z","updated_at":"2025-08-18T14:18:44.273Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30382269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T12:49:11.341Z","status":"ssl_error","status_checked_at":"2026-03-11T12:46:41.342Z","response_time":84,"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","error-handler","error-handling","error-monitoring","error-reporting","go","golang"],"created_at":"2024-07-30T20:01:28.737Z","updated_at":"2026-03-11T13:06:09.889Z","avatar_url":"https://github.com/emperror.png","language":"Go","readme":"![Emperror](.github/logo.png?raw=true)\n\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge-flat.svg)](https://github.com/avelino/awesome-go#error-handling)\n\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/emperror/emperror/CI?style=flat-square)](https://github.com/emperror/emperror/actions?query=workflow%3ACI)\n[![Codecov](https://img.shields.io/codecov/c/github/emperror/emperror?style=flat-square)](https://codecov.io/gh/emperror/emperror)\n[![Go Report Card](https://goreportcard.com/badge/emperror.dev/emperror?style=flat-square)](https://goreportcard.com/report/emperror.dev/emperror)\n![Go Version](https://img.shields.io/badge/go%20version-%3E=1.12-61CFDD.svg?style=flat-square)\n[![PkgGoDev](https://pkg.go.dev/badge/mod/emperror.dev/emperror)](https://pkg.go.dev/mod/emperror.dev/emperror)\n[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B8125%2Femperror.dev%2Femperror.svg?type=shield)](https://app.fossa.com/projects/custom%2B8125%2Femperror.dev%2Femperror?ref=badge_shield)\n\n\n**The Emperor takes care of all errors personally.**\n\nGo's philosophy encourages to gracefully handle errors whenever possible,\nbut some times recovering from an error is not.\n\nIn those cases handling the error means making the best effort to record every detail\nfor later inspection, doing that as high in the application stack as possible.\n\nThis project provides tools to make error handling easier.\n\nRead more about the topic here:\n\n- https://dave.cheney.net/2016/04/27/dont-just-check-errors-handle-them-gracefully\n- https://8thlight.com/blog/kyle-krull/2018/08/13/exploring-error-handling-patterns-in-go.html\n- https://banzaicloud.com/blog/error-handling-go/\n\n\n## Features\n\n- Various error handling strategies (eg. logging, third-party error services) using a simple interface\n- Various helpers related to error handling (recovery from panics, etc)\n- [Integrations](https://github.com/emperror?utf8=%E2%9C%93\u0026q=handler-*\u0026type=\u0026language=) with well-known error catchers and libraries:\n    - [Logur](https://github.com/logur/logur)\n    - [Logrus](https://github.com/sirupsen/logrus)\n    - [Sentry](https://sentry.io) [SDK](https://godoc.org/github.com/getsentry/raven-go) (both hosted and on-premise)\n    - [Bugsnag](https://bugsnag.com) [SDK](https://godoc.org/github.com/bugsnag/bugsnag-go)\n    - [Airbrake](https://airbrake.com) [SDK](https://godoc.org/github.com/airbrake/gobrake) / [Errbit](https://errbit.com/)\n    - [Rollbar](https://rollbar.com) [SDK](https://godoc.org/github.com/rollbar/rollbar-go)\n\n\n## Installation\n\n```bash\ngo get emperror.dev/emperror\n```\n\n\n## Usage\n\n### Log errors\n\nLogging is one of the most common target to record error events.\n\nEmperror has two logger integrations by default:\n- [Logur handler](https://github.com/emperror/handler-logur)\n- [Logrus handler](https://github.com/emperror/handler-logrus)\n\n\n### Annotate errors passing through an error handler\n\nEmperror can annotate errors with details as defined in [emperror.dev/errors](https://github.com/emperror/errors)\n\n```go\npackage main\n\nimport (\n\t\"emperror.dev/emperror\"\n\t\"emperror.dev/errors\"\n)\n\nfunc main() {\n\thandler := emperror.WithDetails(newHandler(), \"key\", \"value\")\n\n\terr := errors.New(\"error\")\n\n\t// handled error will receive the handler details\n\thandler.Handle(err)\n}\n```\n\n### Panics and recovers\n\n```go\npackage main\n\nimport (\n\t\"emperror.dev/emperror\"\n\t\"emperror.dev/errors\"\n)\n\nfunc main() {\n\tvar handler emperror.Handler = newHandler()\n\n\t// Recover from panics and handle them as errors\n\tdefer emperror.HandleRecover(handler)\n\n\t// nil errors will not panic\n\temperror.Panic(nil)\n\n\t// this will panic if foo returns with a non-nil error\n\t// useful in main func for initial setup where \"if err != nil\" does not make much sense\n\temperror.Panic(foo())\n}\n\nfunc foo() error {\n\treturn errors.New(\"error\")\n}\n```\n\n### Filter errors\n\nSometimes you might not want to handle certain errors that reach the error handler.\nA common example is a catch-all error handler in a server. You want to return business errors to the client.\n\n```go\npackage main\n\nimport (\n\t\"emperror.dev/emperror\"\n\t\"emperror.dev/errors/match\"\n)\n\nfunc main() {\n\tvar handler emperror.Handler = emperror.WithFilter(newHandler(), match.Any{/*any emperror.ErrorMatcher*/})\n\n    // errors matching the provided matcher will not be handled\n\thandler.Handle(err)\n}\n```\n\n\n## Development\n\nContributions are welcome! :)\n\n1. Clone the repository\n1. Make changes on a new branch\n1. Run the test suite:\n    ```bash\n    ./pleasew build\n    ./pleasew test\n    ./pleasew gotest\n    ./pleasew lint\n    ```\n1. Commit, push and open a PR\n\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n\n[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B8125%2Femperror.dev%2Femperror.svg?type=large)](https://app.fossa.com/projects/custom%2B8125%2Femperror.dev%2Femperror?ref=badge_large)\n","funding_links":[],"categories":["Error Handling","Miscellaneous","错误处理","错误处理`go 语言错误处理库`","Relational Databases","Go"],"sub_categories":["Search and Analytic Databases","检索及分析资料库","SQL 查询语句构建库","Advanced Console UIs"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femperror%2Femperror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femperror%2Femperror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femperror%2Femperror/lists"}