From f8c8d104fc70624b227cb38292a82d942b83d454 Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Wed, 13 Aug 2014 15:09:20 +0200 Subject: [PATCH] Added error message to PropSI output to close https://github.com/CoolProp/CoolProp/issues/95 Signed-off-by: Ian Bell --- src/CoolProp.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/CoolProp.cpp b/src/CoolProp.cpp index dc35f255..4f67ff81 100644 --- a/src/CoolProp.cpp +++ b/src/CoolProp.cpp @@ -427,13 +427,15 @@ double PropsSI(const std::string &Output, const std::string &Name1, double Prop1 #else std::cout << "macro is on; error checking disabled in PropsSI" << std::endl; #endif - // Here is the real code + // BEGIN OF TRY + // Here is the real code that is inside the try block extract_backend(Ref, backend, fluid); return _PropsSI(Output, Name1, Prop1, Name2, Prop2, backend, fluid, std::vector()); + // END OF TRY #if !defined(PROPSSI_NO_ERROR_CATCH) } catch(const std::exception& e){ - set_error_string(e.what()); + set_error_string(e.what() + format(" : PropsSI(\"%s\",\"%s\",%0.10g,\"%s\",%0.10g,\"%s\")",Output.c_str(),Name1.c_str(), Prop1, Name2.c_str(), Prop2, Ref.c_str())); #if defined (PROPSSI_ERROR_STDOUT) std::cout << e.what() << std::endl; #endif