Skip to content

Commit bed04dd

Browse files
committed
[BCN-458] Added Unwrap method
1 parent 4f1eb1e commit bed04dd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

avroregistry/errors.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ type UnavailableError struct {
1313
func (m *UnavailableError) Error() string {
1414
return fmt.Sprintf("schema registry unavailability caused by: %v", m.Cause)
1515
}
16+
17+
// Unwrap unwraps and return Cause error. It is needed to properly handle %w usage in fmt.Errorf cases.
18+
func (e *UnavailableError) Unwrap() error {
19+
return e.Cause
20+
}

0 commit comments

Comments
 (0)