@@ -19,8 +19,9 @@ type remoteActionRouter struct {
1919 initialSizeClassAnalyzer initialsizeclass.Analyzer
2020}
2121
22- // NewRemoteActionRouter creates an ActionRouter that delegates routing decisions to a remote gRPC service.
23- // Initial size class selection is performed locally using the provided analyzer.
22+ // NewRemoteActionRouter creates an ActionRouter that delegates routing
23+ // decisions to a remote gRPC service. Initial size class selection is
24+ // performed locally using the provided analyzer.
2425func NewRemoteActionRouter (client remoteactionrouter.ActionRouterClient , initialSizeClassAnalyzer initialsizeclass.Analyzer ) ActionRouter {
2526 return & remoteActionRouter {
2627 client : client ,
@@ -49,7 +50,7 @@ func (ar *remoteActionRouter) RouteAction(ctx context.Context, digestFunction di
4950
5051 platformKey , err := platform .NewKey (digestFunction .GetInstanceName (), action .Platform )
5152 if err != nil {
52- return nil , platform.Key {}, nil , nil , status .Error (codes .Internal , "Malformed platform in remote action router response" )
53+ return nil , platform.Key {}, nil , nil , util . StatusWrapWithCode ( err , status .Error (codes .Internal , "Malformed platform in remote action router response" ) )
5354 }
5455
5556 if len (response .InvocationKeys ) == 0 {
@@ -59,7 +60,7 @@ func (ar *remoteActionRouter) RouteAction(ctx context.Context, digestFunction di
5960 for _ , anyKey := range response .InvocationKeys {
6061 invocationKey , err := invocation .NewKey (anyKey )
6162 if err != nil {
62- return nil , platform.Key {}, nil , nil , status .Error (codes .Internal , "Malformed invocation key in remote action router response" )
63+ return nil , platform.Key {}, nil , nil , util . StatusWrapWithCode ( err , status .Error (codes .Internal , "Malformed invocation key in remote action router response" ) )
6364 }
6465 invocationKeys = append (invocationKeys , invocationKey )
6566 }
0 commit comments