@@ -44,14 +44,14 @@ func (es *eventbusService) GetEventbusByName(ctx context.Context, ns, name strin
4444
4545 pb , err := es .nsSvc .GetNamespaceByName (ctx , ns )
4646 if err != nil {
47- return nil , errors .To (err )
47+ return nil , errors .UnwrapOrUnknown (err )
4848 }
4949 eb , err := es .client .GetEventbusWithHumanFriendly (ctx , & ctrlpb.GetEventbusWithHumanFriendlyRequest {
5050 NamespaceId : pb .Id ,
5151 EventbusName : name ,
5252 })
5353 if err != nil {
54- return nil , errors .To (err )
54+ return nil , errors .UnwrapOrUnknown (err )
5555 }
5656
5757 // es.cache.Store(key, eb) unmask when dirty cache is resolved
@@ -66,7 +66,7 @@ func (es *eventbusService) GetEventbus(ctx context.Context, id uint64) (*meta.Ev
6666
6767 eb , err := es .client .GetEventbus (ctx , wrapperspb .UInt64 (id ))
6868 if err != nil {
69- return nil , errors .To (err )
69+ return nil , errors .UnwrapOrUnknown (err )
7070 }
7171
7272 // es.cache.Store(id, eb) unmask when dirty cache is resolved
@@ -93,7 +93,7 @@ func (es *eventbusService) CreateSystemEventbusIfNotExist(ctx context.Context, n
9393
9494 nsPb , err := es .nsSvc .GetSystemNamespace (ctx )
9595 if err != nil {
96- return nil , errors .To (err )
96+ return nil , errors .UnwrapOrUnknown (err )
9797 }
9898
9999 eventbus , err := es .client .CreateSystemEventbus (ctx , & ctrlpb.CreateEventbusRequest {
@@ -102,12 +102,12 @@ func (es *eventbusService) CreateSystemEventbusIfNotExist(ctx context.Context, n
102102 Description : desc ,
103103 NamespaceId : nsPb .Id ,
104104 })
105- return eventbus , errors .To (err )
105+ return eventbus , errors .UnwrapOrUnknown (err )
106106}
107107
108108func (es * eventbusService ) Delete (ctx context.Context , id uint64 ) error {
109109 _ , err := es .client .DeleteEventbus (ctx , wrapperspb .UInt64 (id ))
110- return errors .To (err )
110+ return errors .UnwrapOrUnknown (err )
111111}
112112
113113func (es * eventbusService ) RawClient () ctrlpb.EventbusControllerClient {
0 commit comments