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

feat: customize error codec #422

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pipiaha
Copy link

@pipiaha pipiaha commented Sep 27, 2024

This pull request introduces a new ErrorWrapper interface and its default implementation to handle error serialization and deserialization more effectively. The changes impact multiple files, primarily focusing on the serialize package and its integration with the Builder struct.

Error Handling Improvements:

  • Added ErrorWrapper interface and its default implementation pitayaErrWrapper to handle custom error serialization and deserialization. (pkg/serialize/serializer.go) [1] [2]
  • Updated GetErrorFromPayload and GetErrorPayload functions to use the new DefaultErrWrapper for error handling. (pkg/util/util.go)

Builder Enhancements:

  • Added ErrWrapper field to the Builder struct to allow custom error wrappers. (pkg/builder.go)
  • Modified the Build method to set the DefaultErrWrapper if ErrWrapper is provided. (pkg/builder.go)

Dependency Updates:

  • Updated imports to include necessary packages for the new error handling functionality. (pkg/serialize/serializer.go)

also see #371

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

Successfully merging this pull request may close these issues.

1 participant