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)
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 theserialize
package and its integration with theBuilder
struct.Error Handling Improvements:
ErrorWrapper
interface and its default implementationpitayaErrWrapper
to handle custom error serialization and deserialization. (pkg/serialize/serializer.go
) [1] [2]GetErrorFromPayload
andGetErrorPayload
functions to use the newDefaultErrWrapper
for error handling. (pkg/util/util.go
)Builder Enhancements:
ErrWrapper
field to theBuilder
struct to allow custom error wrappers. (pkg/builder.go
)Build
method to set theDefaultErrWrapper
ifErrWrapper
is provided. (pkg/builder.go
)Dependency Updates:
pkg/serialize/serializer.go
)also see #371