Added myexeption to throw errors and show using MyExeption class.

This commit is contained in:
Christian
2019-03-01 11:12:44 +01:00
parent c0c6bf63a0
commit b19c03f524
10 changed files with 76 additions and 32 deletions
+4 -3
View File
@@ -9,6 +9,7 @@
#include "bedionization.hpp"
#include "myexeption.h"
#include "constants.hpp"
#include <sstream>
@@ -27,7 +28,7 @@ double BED_Ionization::get_TCS(double T_eV) {
if (T_eV<=0) {
stringstream ss;
ss<<"get_TCS(double T_eV): Input energy T_eV="<<T_eV<<" eV < 0.";
throw (ss.str());
throw MyException(ss.str());
}
if (T_eV<=B_eV) {
@@ -45,11 +46,11 @@ double BED_Ionization::get_SDCS (double T_eV, double W_eV) {
if (T_eV<0) {
stringstream ss;
ss<<"getSDCS(double T_eV, double W_eV): Input energy T_eV="<<T_eV<<" eV < 0.";
throw (ss.str());
throw MyException(ss.str());
} else if (W_eV<0) {
stringstream ss;
ss<<"getSDCS(double T_eV, double W_eV): Input energy W_eV="<<W_eV<<" eV < 0.";
throw (ss.str());
throw MyException(ss.str());
}
if ( (T_eV<=B_eV) ||(W_eV >= (T_eV-B_eV) ) ) {