mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-01-15 00:48:18 -05:00
Correct get_parameter_information_string, fixes #974
Put the catch in a more useful way and solves the call to CoolProp::get_parameter_information.
This commit is contained in:
@@ -251,15 +251,12 @@ EXPORT_CODE long CONVENTION get_parameter_information_string(const char *param,
|
||||
{
|
||||
try{
|
||||
int key = CoolProp::get_parameter_index(param);
|
||||
if (key >= 0){
|
||||
std::string s = CoolProp::get_parameter_information(key, Output);
|
||||
return str2buf(s, Output, n) ? 1 : 0;
|
||||
}
|
||||
else{
|
||||
str2buf(format("parameter is invalid: %s", param), Output, n);
|
||||
}
|
||||
std::string s = CoolProp::get_parameter_information(key, "long");
|
||||
return str2buf(s, Output, n) ? 1 : 0;
|
||||
}
|
||||
catch(...){}
|
||||
catch(...){
|
||||
str2buf(format("parameter is invalid: %s", param), Output, n);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EXPORT_CODE long CONVENTION get_fluid_param_string(const char *fluid, const char *param, char * Output, int n)
|
||||
@@ -607,4 +604,4 @@ EMSCRIPTEN_BINDINGS(coolprop_lib_bindings) {
|
||||
function("F2K", &F2K);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user