zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #20576
[Merge] lp:~zorba-coders/zorba/bug1103819-catchAll into lp:zorba
Cezar Andrei has proposed merging lp:~zorba-coders/zorba/bug1103819-catchAll into lp:zorba.
Commit message:
Fix catch ( ... ) in XML loaders.
Requested reviews:
Cezar Andrei (cezar-andrei)
Paul J. Lucas (paul-lucas)
Related bugs:
Bug #1103819 in Zorba: "Use of "catch (...)" should be reduced or mitigated"
https://bugs.launchpad.net/zorba/+bug/1103819
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug1103819-catchAll/+merge/159053
Fix catch ( ... ) in XML loaders.
--
https://code.launchpad.net/~zorba-coders/zorba/bug1103819-catchAll/+merge/159053
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/store/naive/loader_dtd.cpp'
--- src/store/naive/loader_dtd.cpp 2013-03-05 22:57:42 +0000
+++ src/store/naive/loader_dtd.cpp 2013-04-16 00:50:38 +0000
@@ -355,6 +355,16 @@
FragmentXmlLoader::endDocument(theFragmentStream->ctxt->userData); // this would not be called otherwise
}
+ catch( std::exception const &e )
+ {
+ theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR,
+ ERROR_PARAMS( e.what() )));
+
+ abortload();
+ thePathStack.clear();
+ return NULL;
+ }
catch (...)
{
abortload();
@@ -849,8 +859,19 @@
return NULL;
}
}
+ catch( std::exception const &e )
+ {
+ theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR, ERROR_PARAMS( e.what() )));
+
+ abortload();
+ return NULL;
+ }
catch(...)
{
+ theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR));
+
abortload();
thePathStack.clear();
return NULL;
@@ -1070,6 +1091,12 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->add_error(
@@ -1152,6 +1179,12 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->add_error(
@@ -1446,6 +1479,12 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->
@@ -1578,6 +1617,12 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->add_error(
@@ -1629,6 +1674,12 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->add_error(
@@ -1682,6 +1733,12 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->add_error(
@@ -1732,6 +1789,12 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->add_error(
@@ -1775,6 +1838,12 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->add_error(
=== modified file 'src/store/naive/loader_fast.cpp'
--- src/store/naive/loader_fast.cpp 2013-04-08 22:59:58 +0000
+++ src/store/naive/loader_fast.cpp 2013-04-16 00:50:38 +0000
@@ -445,7 +445,7 @@
if (numChars < 0)
{
theXQueryDiagnostics->
- add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR));
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR));
abortload();
return NULL;
@@ -453,8 +453,20 @@
xmlParseChunk(ctxt, theBuffer, 0, 1);
}
+ catch( std::exception const &e )
+ {
+ theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR,
+ ERROR_PARAMS( e.what() )));
+
+ abortload();
+ return NULL;
+ }
catch(...)
{
+ theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR));
+
abortload();
return NULL;
}
@@ -534,10 +546,16 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->
- add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR));
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR));
}
}
@@ -619,6 +637,12 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->add_error(
@@ -860,6 +884,12 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->
@@ -988,6 +1018,12 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->add_error(
@@ -1039,6 +1075,12 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->add_error(
@@ -1092,6 +1134,12 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->add_error(
@@ -1142,6 +1190,12 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->add_error(
@@ -1187,6 +1241,12 @@
{
loader.theXQueryDiagnostics->add_error( e );
}
+ catch( std::exception const &e )
+ {
+ loader.theXQueryDiagnostics->
+ add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics->add_error(
Follow ups