Update c++ error handling