Changeset 11769


Ignore:
Timestamp:
08/03/11 22:06:06 (13 years ago)
Author:
tbretz
Message:
Throw exceptions with text; do not use stoi otherwise we have to catch the exception.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Configuration.cc

    r11594 r11769  
    403403    boost::smatch what;
    404404    if (!boost::regex_match(database, what, expr, boost::match_extra))
    405     {
    406         cout << "Couldn't parse '" << database << "'." << endl;
    407         throw;
    408     }
     405        throw runtime_error("Couldn't parse '"+database+"'.");
    409406
    410407    if (what.size()!=10)
    411     {
    412         cout << "Error parsing '" << database << "'." << endl;
    413         throw;
    414     }
     408        throw runtime_error("Error parsing '"+database+"'.");
    415409
    416410    const string user   = what[2];
     
    418412    const string server = what[5];
    419413    const string db     = what[9];
    420     const int port      = stoi(string(what[7]));
     414    const int port      = atoi(string(what[7]).c_str());
    421415
    422416    cout << "Connecting to '";
Note: See TracChangeset for help on using the changeset viewer.