|
@@ -7,6 +7,8 @@ import (
|
|
|
log "github.com/sirupsen/logrus"
|
|
log "github.com/sirupsen/logrus"
|
|
|
"google.golang.org/genproto/googleapis/api/httpbody"
|
|
"google.golang.org/genproto/googleapis/api/httpbody"
|
|
|
"google.golang.org/grpc"
|
|
"google.golang.org/grpc"
|
|
|
|
|
+ "google.golang.org/grpc/codes"
|
|
|
|
|
+ "google.golang.org/grpc/status"
|
|
|
|
|
|
|
|
"errors"
|
|
"errors"
|
|
|
"net"
|
|
"net"
|
|
@@ -70,7 +72,7 @@ func (api *oliveTinAPI) StartAction(ctx ctx.Context, req *pb.StartActionRequest)
|
|
|
api.executor.MapActionIdToBindingLock.RUnlock()
|
|
api.executor.MapActionIdToBindingLock.RUnlock()
|
|
|
|
|
|
|
|
if pair == nil || pair.Action == nil {
|
|
if pair == nil || pair.Action == nil {
|
|
|
- return nil, errors.New("Action not found")
|
|
|
|
|
|
|
+ return nil, status.Errorf(codes.NotFound, "Action not found.")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
execReq := executor.ExecutionRequest{
|
|
execReq := executor.ExecutionRequest{
|
|
@@ -153,7 +155,7 @@ func (api *oliveTinAPI) StartActionByGetAndWait(ctx ctx.Context, req *pb.StartAc
|
|
|
LogEntry: internalLogEntryToPb(internalLogEntry),
|
|
LogEntry: internalLogEntryToPb(internalLogEntry),
|
|
|
}, nil
|
|
}, nil
|
|
|
} else {
|
|
} else {
|
|
|
- return nil, errors.New("Execution not found!")
|
|
|
|
|
|
|
+ return nil, status.Errorf(codes.NotFound, "Execution not found.")
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -211,7 +213,11 @@ func (api *oliveTinAPI) ExecutionStatus(ctx ctx.Context, req *pb.ExecutionStatus
|
|
|
ile = getMostRecentExecutionStatusById(api, req.ActionId)
|
|
ile = getMostRecentExecutionStatusById(api, req.ActionId)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- res.LogEntry = internalLogEntryToPb(ile)
|
|
|
|
|
|
|
+ if ile == nil {
|
|
|
|
|
+ return nil, status.Errorf(codes.NotFound, "Execution not found.")
|
|
|
|
|
+ } else {
|
|
|
|
|
+ res.LogEntry = internalLogEntryToPb(ile)
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return res, nil
|
|
return res, nil
|
|
|
}
|
|
}
|