Commit 859d3137 authored by Sebastien Timmermans's avatar Sebastien Timmermans 🎹

[New] error mngmt un mbs_load

parent cad3c8e9
Pipeline #4337 passed with stage
in 9 minutes and 2 seconds
......@@ -70,7 +70,9 @@ MbsData* mbs_load_with_loader(const char* mbs_filename, const char* build_path,
// 0. build
if (build_path == NULL)
{
mbs_error_msg(">>LOAD>> build_path is not defined \n");
mbs_msg(">>LOAD>> build_path is not defined \n");
mbs_msg("\n>>LOAD>> Check your files names and paths \n\n");
mbs_error_msg("[%d] in mbs_load_with_loader !! \n", -980);
}
// 1. symbolic Library name (without extension)
......@@ -160,8 +162,6 @@ MbsData* mbs_load_with_loader(const char* mbs_filename, const char* build_path,
{
// do nothing as the loader->mds memory could be re-used.
}
return mbs_data;
}
......
......@@ -1522,15 +1522,18 @@ MDS_gen_strct* MDS_mbs_reader(const char* mbs_xml_name)
xmlKeepBlanksDefault(0); // Ignore les noeuds texte composant la mise en forme
doc = xmlParseFile(mbs_xml_name);
if (doc == NULL) {
//fprintf(stderr, "MDS_mbs_reader : Invalid XML document\n");
mbs_error_msg("MDS_mbs_reader : Impossible to read file %s\n", mbs_xml_name);
mbs_msg(">>LOAD>> MDS_mbs_reader : Invalid XML document\n");
mbs_msg(">>LOAD>> Check your files names and paths \n\n");
mbs_error_msg("[%d] in MDS_mbs_reader !! \n", -999);
return NULL;
}
// getting the root
root = xmlDocGetRootElement(doc);
if (root == NULL) {
fprintf(stderr, "MDS_mbs_reader : Empty XML document\n");
mbs_msg(">>LOAD>> MDS_mbs_reader : Empty XML document\n");
mbs_msg(">>LOAD>> Check your files names and paths \n\n");
xmlFreeDoc(doc);
mbs_error_msg("[%d] in MDS_mbs_reader !! \n", -999);
return NULL;
}
......
......@@ -55,7 +55,9 @@ void find_project_path(const char* mbsfile, char* prjpath){
}
else{
mbs_error_msg("the *.mbs file must be in the dataR folder. \n");
mbs_msg(">>LOAD>> the *.mbs file must be in the dataR folder. \n");
mbs_msg("\n>>LOAD>> Check your files names and paths \n\n");
mbs_error_msg("[%d] in find_project_path !! \n", -989);
exit(1);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment