Skip to content

Commit cc747ca

Browse files
committed
RPC: Tolerate non-critical errors when loading solution
1 parent f8e931e commit cc747ca

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tools/projmgr/src/ProjMgrRpcServer.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,13 @@ RpcArgs::SuccessResult RpcHandler::LoadSolution(const string& solution, const st
291291
result.message = solution + " is not a *.csolution.yml file";
292292
return result;
293293
}
294-
result.success = m_solutionLoaded = m_manager.LoadSolution(csolutionFile, activeTarget);
295-
if(!m_solutionLoaded) {
294+
// we disregard return value of m_manager.LoadSolution() here, because we tolerate some errors
295+
m_manager.LoadSolution(csolutionFile, activeTarget);
296+
map<string, ContextItem>* contexts = nullptr;
297+
m_worker.GetContexts(contexts);
298+
result.success = m_solutionLoaded = contexts && !contexts->empty();
299+
if(!result.success) {
300+
// severe situation: contexts were not populated
296301
result.message = "failed to load and process solution " + csolutionFile;
297302
}
298303
return result;

0 commit comments

Comments
 (0)