mirror of
https://github.com/google/ax.git
synced 2026-10-02 03:14:37 +08:00
Always return State_STATE_FAILED when there is an error
This commit is contained in:
@@ -50,7 +50,6 @@ func (s *Server) TriggerSession(req *proto.TriggerSessionRequest, stream grpc.Se
|
||||
|
||||
// Trigger the session
|
||||
if err := s.controller.TriggerSession(stream.Context(), sessionID, inputs, checkpointID); err != nil {
|
||||
// Send failure response
|
||||
stream.Send(&proto.TriggerSessionResponse{
|
||||
SessionId: sessionID,
|
||||
State: proto.State_STATE_FAILED,
|
||||
@@ -61,6 +60,10 @@ func (s *Server) TriggerSession(req *proto.TriggerSessionRequest, stream grpc.Se
|
||||
// Get session state
|
||||
session, err := s.controller.GetSession(sessionID)
|
||||
if err != nil {
|
||||
stream.Send(&proto.TriggerSessionResponse{
|
||||
SessionId: sessionID,
|
||||
State: proto.State_STATE_FAILED,
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user