mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4429 Implement return status handling for command file interface
This commit is contained in:
@@ -73,8 +73,15 @@ grpc::Status RiaGrpcCommandService::Execute(grpc::ServerContext* context, const
|
||||
}
|
||||
}
|
||||
}
|
||||
commandHandle->execute();
|
||||
|
||||
RicfCommandResponse response = commandHandle->execute();
|
||||
if (response.status() == RicfCommandResponse::COMMAND_ERROR)
|
||||
{
|
||||
return grpc::Status(grpc::FAILED_PRECONDITION, response.message().toStdString());
|
||||
}
|
||||
else if (response.status() == RicfCommandResponse::COMMAND_WARNING)
|
||||
{
|
||||
context->AddInitialMetadata("warning", response.message().toStdString());
|
||||
}
|
||||
return Status::OK;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user