{"id":21121424,"url":"https://github.com/oneofone/oerrs","last_synced_at":"2026-04-21T20:32:36.771Z","repository":{"id":57597189,"uuid":"377292627","full_name":"OneOfOne/oerrs","owner":"OneOfOne","description":"Yet another go package with an error list","archived":false,"fork":false,"pushed_at":"2023-07-21T19:22:35.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-21T05:25:04.493Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/OneOfOne.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":"2021-06-15T21:01:32.000Z","updated_at":"2022-05-31T12:03:43.000Z","dependencies_parsed_at":"2024-06-21T13:24:21.536Z","dependency_job_id":null,"html_url":"https://github.com/OneOfOne/oerrs","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneOfOne%2Foerrs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneOfOne%2Foerrs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneOfOne%2Foerrs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneOfOne%2Foerrs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OneOfOne","download_url":"https://codeload.github.com/OneOfOne/oerrs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243566398,"owners_count":20311873,"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":[],"created_at":"2024-11-20T03:50:16.740Z","updated_at":"2025-12-29T20:05:58.400Z","avatar_url":"https://github.com/OneOfOne.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oerrs\n\n[![Go Reference](https://pkg.go.dev/badge/go.oneofone.dev/oerrs.svg)](https://pkg.go.dev/go.oneofone.dev/oerrs)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/OneOfOne/oerrs)\n\n[godocs]: https://pkg.go.dev/go.oneofone.dev/oerrs\n\n`oerrs` is a package for Go that builds on top of [`golang.org/x/xerrors`](https://golang.org/x/xerrors).\n\nAdds an ErrorList with optional stack traces.\n\n## Installation and Docs\n\nInstall using `go get go.oneofone.dev/oerrs`.\n\nPackage documentation: \u003chttps://pkg.go.dev/go.oneofone.dev/oerrs\u003e\n\n### Requires go version 1.18 or newer\n\n## Features\n\n* Passes through most [`golang.org/x/xerrors`](https://golang.org/x/xerrors) functions and interfaces to make life easier.\n* A complete drop-in replacement for `xerrors`\n* A complete drop-in replacement for `errgroup`\n* `ErrorList` handles multiple errors in a sane way.\n* `ErrorList` can optionally be toggled to enable thread safety.\n* `Try/Catch` *needs doc*.\n* All errors can support be toggled to support JSON output.\n\n## Usage\n\n`oerrs` was made to make error handling easier\n\n## Examples\n\n```go\nvar errs oerrs.ErrorList\n\nerrs.PushIf(step1())\nerrs.PushIf(step2())\nif errs.PushIf(step3()) {\n\t// do something\n}\nreturn errs.Err()\n\n```\n\n`oerrs.ErrorList` implements `error`\n\n```go\n\nif err := something(); err != nil {\n\tif el, ok := err.(*oerrs.ErrorList); ok {\n\t\t// Use merr.Errors\n\t}\n\t// or\n\tvar el *oerrs.ErrorList\n\tif errors.As(err, \u0026el) {\n\t\t// use el.Errors\n\t}\n}\n\n\n```\n\n```go\n// try / catch\n\nfunc doStuff() (res Response, err error) {\n\tdefer oerrs.Catch(\u0026err, nil)\n\n\ta := Try1(someFunThatReturnValAndErr())\n\t// do something with a\n\tb := Try1(someOtherFunc(a))\n\n\treturn a + b, nil\n}\n\n```\n\n## License\n\nThe code of errgroup is mostly copied from  [`golang.org/x/sync`](https://golang.org/x/sync) for personal convience, all rights reserved to go devs.\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foneofone%2Foerrs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foneofone%2Foerrs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foneofone%2Foerrs/lists"}