Project

General

Profile

Task #2541

Updated by Junxiao Shi over 9 years ago

In a real world deployment, With currently implemented exception mechanism, it is difficulty close to impossible determine cause of the exception. 
 It either needs exception without modifying the code modification, or (or running gdb with `catch throw`. catch throw, which can be also problematic). 

 Boost has partial solution to the problem: **Boost Exception library**. 
 The problem in the form of Boost Exception: in addition to whatever information about the exception is that we currently have, the exception can be annotated with additional information, including: such as source name, function name, and line number of the place of the exception throwing. throwing    (to make use of this, `BOOST_THROW_EXCEPTION` macros should be used instead of just throw statement: http://www.boost.org/doc/libs/1_57_0/libs/exception/doc/BOOST_THROW_EXCEPTION.html). 

 This issue includes: 

 * replace all `throw` exceptions with [`BOOST_THROW_EXCEPTION` macros](http://www.boost.org/doc/libs/1_48_0/libs/exception/doc/BOOST_THROW_EXCEPTION.html) 
 * in NFD `main.cpp`'s top-level `catch`, print the annotated additional information into the fatal log I think if we move to this mechanism, problem debugging would get much easier.

Back