This adds a chapter on error handling. We're using a mechanism very similar to [libgit2] where any fallible operation will return an "obviously" invalid value (e.g. 0 or null) and set a thread-local variable. This thread-local variable can later be queried by C/C++ to get an error message.
We also talk about exception safety (i.e. wrap everything in panic::catch_unwind()) and using logging as a form of print statements.
This adds a chapter on error handling. We're using a mechanism very similar to [libgit2] where any fallible operation will return an "obviously" invalid value (e.g.
0
ornull
) and set a thread-local variable. This thread-local variable can later be queried by C/C++ to get an error message.We also talk about exception safety (i.e. wrap everything in
panic::catch_unwind()
) and using logging as a form of print statements.(fixes #22)