Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Add errors.ConjureErrorDecoder interface & instantiable registry type for customizing error deserialization #724

Merged
merged 6 commits into from
Nov 27, 2024

Conversation

bmoylan
Copy link
Contributor

@bmoylan bmoylan commented Nov 27, 2024

Builds off #716

Part of addressing palantir/conjure-go#415

Used by palantir/conjure-go#636

tabboud
tabboud previously approved these changes Nov 27, 2024
Copy link
Contributor

@tabboud tabboud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

}

// ReflectTypeConjureErrorDecoder is a ConjureErrorDecoder that uses reflection to convert JSON errors to their go types.
// It stores a mapping of error name to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: need to finish up the godoc

)

var registry = map[string]reflect.Type{}
var globalRegistry = NewReflectTypeConjureErrorDecoder()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👍

@bulldozer-bot bulldozer-bot bot merged commit 0e3ae59 into develop Nov 27, 2024
5 checks passed
@bulldozer-bot bulldozer-bot bot deleted the bm/ta/415-conjureErrorDecoder branch November 27, 2024 21:28
@autorelease3
Copy link

autorelease3 bot commented Nov 27, 2024

Released v2.88.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants