Skip to content

Instantly share code, notes, and snippets.

@akindyakov
Last active December 26, 2015 07:19
Show Gist options
  • Save akindyakov/7114657 to your computer and use it in GitHub Desktop.
Save akindyakov/7114657 to your computer and use it in GitHub Desktop.
#include <sstream>
#include <string>
class AException {
public:
AException(const std::string& whatsWrong)
: name( whatsWrong ),
row(-1) {}
AException(const std::string& whatsWrong, unsigned long int _row)
: name( whatsWrong ),
row(_row) {}
string what()const {
std::stringstream errS;
errS << name;
if ( row > 0 ) {
errS << ". at line : " << row;
}
return errS.str();
}
private:
long int row;
std::string name;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment