00001 #ifndef SMTP_ERROR_H 00002 #define SMTP_ERROR_H 00003 00004 #include <stdexcept> 00005 #include <sstream> 00006 00007 class smtp_error: public std::runtime_error 00008 { 00009 public: 00010 smtp_error(const std::string& err):std::runtime_error(err) 00011 { 00012 std::istringstream is(err); 00013 is>>code; 00014 } 00015 int code; 00016 }; 00017 00018 #endif //SMTP_ERROR_H