Skip to content

config: Show proper traceback on invalid tag in pattern spec

the-very requested to merge github/fork/ijon/show-traceback-on-tag-error into master

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


This change is Reviewable

Merge request reports