config: Show proper traceback on invalid tag in pattern spec
- Jun 30, 2017
-
-
Ivan Chelubeev authoredac02a44b
-
Created by: ijon
Pattern settings blocks are parsed and verified late, long after initial call to HANDY_CONFIG_*
, and this happens in the context of the core (background) thread. If there would happen an error in a tag name then configuration processing function will raise invalid_tag_error
, which in context of the core thread is unexpected and will lead to std::terminate
call.
But that is not the main problem here. Main problem is that user have no means to find a reason to this termination because gcc's implementation of std::thread blocks propagation of exceptions from thread main function, effectively hiding an original traceback/exception location [1].
Supposed fix, for now, is to use noexcept
on the thread main function. Its not general enough but valid for this library. Proper fix will come in gcc v8.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55917