patrickfrey / strusAnalyzer

Library for document analysis (segmentation, tokenization, normalization, aggregation) with the goal to get a set of items that can be inserted into a strus storage. Also some functions for analysing tokens or phrases of the strus query are provided.
http://www.project-strus.net
Mozilla Public License 2.0
3 stars 0 forks source link

exceptions of type strus::runtime_error ignored #44

Closed andreasbaumann closed 7 years ago

andreasbaumann commented 7 years ago

for example: I throw an exception in a segmenter, strusAnalyze happily continues to index the document. The exception in this case was thrown in the defineSubSection method of the segmenter as such:

throw strus::runtime_error(_TXT("xxx"));

When I see the definition of 'runtime_error', it seems to me that this is a function in internationatiztion.hpp/cpp!

And the code is mixed up with std::runtime_error and code throwing a strus::runtime_error which will then never be caught. For instance in programLoader.cpp there is a catch (std::runtime_error).

Defining a function with the same name as a standard exception name is very counter-intuitive!

If I change it to std::runtime_error also nothing gets catched.

I'm really puzzled here..

andreasbaumann commented 7 years ago

Ah. strus::runtime_error returns a std::runtime_error exception. Why the catching doesn't work, is still a puzzle to me.

andreasbaumann commented 7 years ago
try {
}  catch 

was missing across library API boundaries.