diff --git a/pkg/server/storage_api/decommission_test.go b/pkg/server/storage_api/decommission_test.go index 84468fe1e557..2b25ecb78c4f 100644 --- a/pkg/server/storage_api/decommission_test.go +++ b/pkg/server/storage_api/decommission_test.go @@ -889,7 +889,7 @@ func TestAdminDecommissionedOperations(t *testing.T) { }) return err }}, - {"Events", codes.Internal, func(ctx context.Context, c serverpb.AdminClient) error { + {"Events", codes.PermissionDenied, func(ctx context.Context, c serverpb.AdminClient) error { _, err := c.Events(ctx, &serverpb.EventsRequest{}) return err }}, diff --git a/pkg/sql/colexecerror/error.go b/pkg/sql/colexecerror/error.go index 2f977523d870..8923a8f329a5 100644 --- a/pkg/sql/colexecerror/error.go +++ b/pkg/sql/colexecerror/error.go @@ -189,18 +189,17 @@ func shouldCatchPanic(panicEmittedFrom string) bool { // stack, such as the network or storage layers. A StorageError will be bubbled // up all the way past the SQL layer unchanged. type StorageError struct { - error + cause error } -// Cause implements the Causer interface. -func (s *StorageError) Cause() error { - return s.error -} +func (s *StorageError) Error() string { return s.cause.Error() } +func (s *StorageError) Cause() error { return s.cause } +func (s *StorageError) Unwrap() error { return s.cause } // NewStorageError returns a new storage error. This can be used to propagate // an error through the exec subsystem unchanged. func NewStorageError(err error) *StorageError { - return &StorageError{error: err} + return &StorageError{cause: err} } // notInternalError is an error that occurs not because the vectorized engine