Throwing a line is a really bad idea.
Feel free to define your own exception class and have a line embedded inside it (or just get your own exception class from std::runtime_error
, pass the constructor error message and use the what()
method to get the error line on the catch node), but do not output the line !
source share