Disable using exceptions

This change replaces throwing exceptions in THROW_MACRO with calling exit().
This is a workaround since THROW_ERROR macro is used 92 times in this project.
Some member functions that use the macro should return some useful values to
the caller.