@@ -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 , err
47+ return nil , errors . To ( 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 , err
54+ return nil , errors . To ( 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 , err
69+ return nil , errors . To ( err )
7070 }
7171
7272 // es.cache.Store(id, eb) unmask when dirty cache is resolved
@@ -93,20 +93,21 @@ func (es *eventbusService) CreateSystemEventbusIfNotExist(ctx context.Context, n
9393
9494 nsPb , err := es .nsSvc .GetSystemNamespace (ctx )
9595 if err != nil {
96- return nil , err
96+ return nil , errors . To ( err )
9797 }
9898
99- return es .client .CreateSystemEventbus (ctx , & ctrlpb.CreateEventbusRequest {
99+ eventbus , err := es .client .CreateSystemEventbus (ctx , & ctrlpb.CreateEventbusRequest {
100100 Name : name ,
101101 LogNumber : int32 (defaultSystemEventbusEventlog ),
102102 Description : desc ,
103103 NamespaceId : nsPb .Id ,
104104 })
105+ return eventbus , errors .To (err )
105106}
106107
107108func (es * eventbusService ) Delete (ctx context.Context , id uint64 ) error {
108109 _ , err := es .client .DeleteEventbus (ctx , wrapperspb .UInt64 (id ))
109- return err
110+ return errors . To ( err )
110111}
111112
112113func (es * eventbusService ) RawClient () ctrlpb.EventbusControllerClient {
0 commit comments