From be5b96800142ddeca67e1eda4e7fa71968beab86 Mon Sep 17 00:00:00 2001 From: Dave Goodwin Date: Tue, 5 Oct 2004 17:56:47 +0000 Subject: [PATCH] added exceptions for error handling --- ext/tpx/Sub.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ext/tpx/Sub.h b/ext/tpx/Sub.h index cf20e223b..68312f39c 100755 --- a/ext/tpx/Sub.h +++ b/ext/tpx/Sub.h @@ -25,6 +25,18 @@ using namespace std; namespace tpx { + class TPX_Error { + public: + TPX_Error(string p, string e) { + ErrorMessage = e; + ErrorProcedure = p; + } + virtual ~TPX_Error(){} + static string ErrorMessage; + static string ErrorProcedure; + }; + + const double OneAtm = 1.01325e5; const double Liquid = 0.0; const double Vapor = 1.0; @@ -202,7 +214,10 @@ namespace tpx { void update_sat(); void set_Err(int ErrFlag) { - if (!Err) Err = ErrFlag; + if (!Err) { + Err = ErrFlag; + //throw TPX_Error(""errorMsg(Err)); + } } void clear_Err() {Err = 0;}