I have been asked to add an exception class to the digital time problem that excepts two arguments an int value and an error message. I think I have a problem with the catch parameters or maybe the throw statement itself. because when my program encounters an error it crashes. Even the catch(...) does nothing. Do I have a another simple mistake that I just don't see? Or is it something bigger?
DigitalTimeException::DigitalTimeException(int value, string whatWentWrong)
// Set the stored message within the object
// Any text or int value will be accepted as the error message
message = whatWentWrong;
num = value;
// Return the error message stored inside the object
// Return the error number stored inside the object
the function from dtime.cpp that is supposed to throw the error
I just figured out the problem. The other functions that take DigitalTime as an input still had the if statements and exit sequence. I changed them to throw statements and now it works. I was under the impression that I could change the functions one at a time and test them as I go. But after thinking about it for a moment it makes sense why I cant do that.