Added myexeption to throw errors and show using MyExeption class.
This commit is contained in:
@@ -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) ) ) {
|
||||
|
||||
Reference in New Issue
Block a user