ory / ory/herodot

Function to convert gRPC `status.Status` to `DefaultError`

Open
#127 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feat
Dominant language
Go
Stars
130
Forks
18
PR merge metrics
No merged PRs in 30d

Description

Preflight checklist
Ory Network Project

No response

Describe your problem

Although this package contains a server-side gRPC interceptor, there doesn't appear to be a function in the library to convert back from gRPC status.Status() in the client side.

Describe your ideal solution

Would you be open to a pr that adds a function like this?

func (status.Status) DefaultError {}

This function would effectively reverse the steps of DefaultError.GRPCStatus() to reconstruct the original type.

Workarounds or alternatives

I was going to make the function myself anyway, but I may as well add it to the library if this is something others would benefit from

Version

v0.10.2

Additional Context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing DefaultError.GRPCStatus and the server-side gRPC interceptor referenced in the issue. Determine how the proposed client-side conversion should reconstruct the original error type, then add tests showing that conversion works for the supported errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, grpc
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.