{"id":18787241,"url":"https://github.com/pantani/errors","last_synced_at":"2025-12-23T15:30:32.405Z","repository":{"id":57525662,"uuid":"250833919","full_name":"Pantani/errors","owner":"Pantani","description":"Simple abstraction for errors.","archived":false,"fork":false,"pushed_at":"2021-02-26T01:33:11.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-29T13:23:13.302Z","etag":null,"topics":["error","error-handler","error-handling","error-log","error-messages","error-reporting","errors","go","golang"],"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/Pantani.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}},"created_at":"2020-03-28T15:47:43.000Z","updated_at":"2023-09-30T10:43:49.000Z","dependencies_parsed_at":"2022-08-28T20:22:24.272Z","dependency_job_id":null,"html_url":"https://github.com/Pantani/errors","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pantani%2Ferrors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pantani%2Ferrors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pantani%2Ferrors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pantani%2Ferrors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pantani","download_url":"https://codeload.github.com/Pantani/errors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239707320,"owners_count":19684045,"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":["error","error-handler","error-handling","error-log","error-messages","error-reporting","errors","go","golang"],"created_at":"2024-11-07T20:53:56.552Z","updated_at":"2025-12-23T15:30:27.121Z","avatar_url":"https://github.com/Pantani.png","language":"Go","readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/Pantani/errors.svg)](https://pkg.go.dev/github.com/Pantani/errors)\n[![codecov](https://codecov.io/gh/Pantani/errors/branch/master/graph/badge.svg?token=F6HFPDPW9J)](https://codecov.io/gh/Pantani/errors)\n\n# Simple error package\n\nSimple abstraction for errors.\n\nUse this package for create a new error.\nAn error in Go is any implementing interface with an Error() string method. We overwrite the error object by our error struct:\n\n```go\ntype Error struct {\n\tErr   error\n\tType  Type\n\tmeta  map[string]interface{}\n\tstack []string\n}\n```\n\nTo be easier the error construction, the package provides a function named E, which is short and easy to type:\n\n```go\nfunc E(args ...interface{}) *Error\n```\n\nE.g.:\n- just error:\n```go\nerrors.E(err)\n```\n\n- error with message:\n```go\nerrors.E(err, \"new message to append\")\n```\n\n- error with type:\n```go\nerrors.E(err, errors.TypePlatformReques)\n```\n\n- error with type and message:\n```go\nerrors.E(err, errors.TypePlatformReques, \"new message to append\")\n```\n\n\n- error with type and meta:\n```go\nerrors.E(err, errors.TypePlatformRequest, errors.Params{\n\t\t\t\"coin\":   \"Ethereum\",\n\t\t\t\"method\": \"CurrentBlockNumber\",\n\t\t})\n```\n\n- error with meta:\n```go\nerrors.E(err, errors.Params{\n\t\t\t\"coin\":   \"Ethereum\",\n\t\t\t\"method\": \"CurrentBlockNumber\",\n\t\t})\n```\n\n- error with type and meta:\n```go\nerrors.E(err, errors.TypePlatformRequest, errors.Params{\n\t\t\t\"coin\":   \"Ethereum\",\n\t\t\t\"method\": \"CurrentBlockNumber\",\n\t\t})\n```\n\n- error with type, message and meta:\n```go\nerrors.E(err, errors.TypePlatformRequest, \"new message to append\", errors.Params{\n\t\t\t\"coin\":   \"Ethereum\",\n\t\t\t\"method\": \"CurrentBlockNumber\",\n\t\t})\n```\n\n\n- You can send the errors to sentry using `.PushToSentry()`\n```go\nerrors.E(err, errors.TypePlatformReques).PushToSentry()\n```\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpantani%2Ferrors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpantani%2Ferrors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpantani%2Ferrors/lists"}