@@ -539,6 +539,7 @@ void dna_import::ParseXML(const std::string& fileName, vdnaStnPtr* vStations, PU
539539 {
540540 std::stringstream ss;
541541 ss << " The default input file reference frame \" " << referenceframe_p.str () << " \" is not recognised." ;
542+ import_file_mutex.unlock ();
542543 SignalExceptionParse (static_cast <std::string>(ss.str ()), 0 );
543544 }
544545
@@ -566,6 +567,7 @@ void dna_import::ParseXML(const std::string& fileName, vdnaStnPtr* vStations, PU
566567 }
567568 std::stringstream ss;
568569 ss << " ParseXML(): An std::ios_base failure was encountered while parsing " << fileName << " ." << std::endl << " " << f.what ();
570+ import_file_mutex.unlock ();
569571 SignalExceptionParse (static_cast <std::string>(ss.str ()), 0 );
570572 }
571573 catch (const std::system_error& e)
@@ -584,20 +586,22 @@ void dna_import::ParseXML(const std::string& fileName, vdnaStnPtr* vStations, PU
584586 }
585587 std::stringstream ss;
586588 ss << " ParseXML(): An std::ios_base failure was encountered while parsing " << fileName << " ." << std::endl << " " << e.what ();
589+ import_file_mutex.unlock ();
587590 SignalExceptionParse (static_cast <std::string>(ss.str ()), 0 );
588591 }
589- catch (const XMLInteropException& e)
592+ catch (const XMLInteropException& e)
590593 {
591594 std::stringstream ss;
592595 ss << " ParseXML(): An exception was encountered while parsing " << fileName << " ." << std::endl << " " << e.what ();
596+ import_file_mutex.unlock ();
593597 SignalExceptionParse (static_cast <std::string>(ss.str ()), 0 );
594598 }
595599 catch (const ::xml_schema::parsing& e)
596600 {
597601 std::stringstream ss (" " );
598602 ss << e.what ();
599603
600- ::xsd::cxx::parser::diagnostics<char >::const_iterator _it;
604+ ::xsd::cxx::parser::diagnostics<char >::const_iterator _it;
601605 for (_it=e.diagnostics ().begin (); _it!=e.diagnostics ().end (); _it++)
602606 {
603607 ss << std::endl;
@@ -606,19 +610,29 @@ void dna_import::ParseXML(const std::string& fileName, vdnaStnPtr* vStations, PU
606610 ss << " , severity " << _it->severity () << std::endl;
607611 ss << " - " << _it->message ();
608612 }
613+ import_file_mutex.unlock ();
609614 SignalExceptionParse (ss.str (), 0 );
610615 }
611616 catch (const ::xml_schema::exception& e)
612617 {
613618 std::stringstream ss;
614619 ss << " ParseXML(): An xml_schema exception was encountered while parsing " << fileName << " ." << std::endl << " " << e.what ();
620+ import_file_mutex.unlock ();
615621 SignalExceptionParse (static_cast <std::string>(ss.str ()), 0 );
616622 }
623+ catch (const std::exception& e)
624+ {
625+ std::stringstream ss;
626+ ss << " ParseXML(): An error was encountered while parsing " << fileName << " ." << std::endl << " " << e.what ();
627+ import_file_mutex.unlock ();
628+ SignalExceptionParse (ss.str (), 0 );
629+ }
617630 catch (...)
618631 {
619632 std::stringstream ss;
620633 ss << " ParseXML(): An unknown error was encountered while parsing " << fileName << " ." << std::endl;
621- SignalExceptionParse (ss.str (), 0 );
634+ import_file_mutex.unlock ();
635+ SignalExceptionParse (ss.str (), 0 );
622636 }
623637
624638 if (parseStatus_ != PARSE_SUCCESS)
0 commit comments