{"id":16275245,"url":"https://github.com/ncrypthic/protoc-gen-go-errors","last_synced_at":"2025-04-08T16:26:11.919Z","repository":{"id":57707913,"uuid":"499585686","full_name":"ncrypthic/protoc-gen-go-errors","owner":"ncrypthic","description":null,"archived":false,"fork":false,"pushed_at":"2022-06-03T16:53:44.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-14T12:54:35.125Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ncrypthic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-03T16:52:45.000Z","updated_at":"2024-12-12T20:23:11.000Z","dependencies_parsed_at":"2022-09-08T10:01:10.725Z","dependency_job_id":null,"html_url":"https://github.com/ncrypthic/protoc-gen-go-errors","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrypthic%2Fprotoc-gen-go-errors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrypthic%2Fprotoc-gen-go-errors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrypthic%2Fprotoc-gen-go-errors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrypthic%2Fprotoc-gen-go-errors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ncrypthic","download_url":"https://codeload.github.com/ncrypthic/protoc-gen-go-errors/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247880071,"owners_count":21011582,"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-10-10T18:32:35.857Z","updated_at":"2025-04-08T16:26:11.889Z","avatar_url":"https://github.com/ncrypthic.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# protoc-gen-go-errors\n\nThis protobuf plugins enables rpc method to list possible errors returned. The\nplugin will generate single, package level, Go error variable for every error\nlisted. Server may use the generated error variable as return error and client\nCan catch the error with `errors.Is()` assertion.\n\nEvery error definition **MUST** contain two properties:\n\n1. arbitrary error code string\n   This can be served as human friendly error identifier\n\n2. an enumerated gRPC status [code](https://www.grpc.io/docs/guides/error/#error-status-codes)\n   This will be transalated into real gRPC status code which will be used over the wire.\n\nAn simple example will be like below\n\n```protobuf\nsyntax=\"proto3\";\n\nimport \"protoc-gen-go-errors/proto/error.proto\"\n\n// ...\n\nservice Sample {\n  rpc Method(Input) returns (Response) {\n    option(errors.types) = {\n       status: ALREADY_EXISTS,\n       code: \"err_email_exists\"\n    };\n    option(errors.types) = {\n       status: INVALID_ARGUMENT,\n       code: \"err_invalid_email\"\n    };\n  }\n}\n```\n\n## Installation\n\n1. Install protoc-gen-go-errors\n\n```sh\n$ go install github.com/ncrypthic/proto-gen-go-errors\n```\n\n2. Generate error definition Golang file\n\n```sh\nprotoc --go-errors_out=:\u003cdir\u003e -I \u003cpath to protoc-gen-go-errors parent dir\u003e -I \u003cpath to proto file directory\u003e \u003cproto_file_name\u003e\n```\n\n## LICENSE\n\nGNU General Public License v3.0 or later\n\nSee [COPYING](COPYING) to see the full text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncrypthic%2Fprotoc-gen-go-errors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fncrypthic%2Fprotoc-gen-go-errors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncrypthic%2Fprotoc-gen-go-errors/lists"}