EXPORT_CODE void CONVENTION AbstractState_free(const long handle, long *errcode, char *message_buffer, const long buffer_length) { *errcode = 0; try{ handle_manager.remove(handle); } catch(CoolProp::HandleError &e){ std::string errmsg = std::string("HandleError: ") + e.what(); if (errmsg.size() < static_cast<std::size_t>(buffer_length)){ *errcode = 1; strcpy(message_buffer, errmsg.c_str()); } else{ *errcode = 2; } } catch(CoolProp::CoolPropBaseError &e){ std::string errmsg = std::string("Error: ") + e.what(); if (errmsg.size() < static_cast<std::size_t>(buffer_length)){ *errcode = 1; strcpy(message_buffer, errmsg.c_str()); } else{ *errcode = 2; } } catch(...){ *errcode = 3; } }
EXPORT_CODE void CONVENTION AbstractState_free(const long handle, long *errcode, char *message_buffer, const long buffer_length) { *errcode = 0; try{ handle_manager.remove(handle); } catch (...) { HandleException(errcode, message_buffer, buffer_length); } }