X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftimetable.cpp;h=9fd44df6d80a480b6d9eb95e9a3cec1cc82e6550;hb=66c2c7ca5a4bd369293959bc211b040834343381;hp=82c5411378c6e5c0f67277f2e328f3ad56e450f0;hpb=ce29d0ccf89840c9581314301de0ea2b5b261c43;p=r2c2.git diff --git a/source/libr2c2/timetable.cpp b/source/libr2c2/timetable.cpp index 82c5411..9fd44df 100644 --- a/source/libr2c2/timetable.cpp +++ b/source/libr2c2/timetable.cpp @@ -55,7 +55,7 @@ void Timetable::append(const Row &row) void Timetable::insert(unsigned i, const Row &row) { if(i>rows.size()) - throw InvalidParameterValue("Insert position out of range"); + throw out_of_range("Timetable::insert"); rows.insert(rows.begin()+i, row); if(i<=current_row) @@ -65,7 +65,7 @@ void Timetable::insert(unsigned i, const Row &row) const Timetable::Row &Timetable::get_row(unsigned i) const { if(i>=rows.size()) - throw InvalidParameterValue("Row index out of range"); + throw out_of_range("Timetable::get_row"); return rows[i]; } @@ -187,7 +187,7 @@ Zone &Timetable::get_zone(const string &name) { string::size_type space = name.rfind(' '); if(space==string::npos || space==0) - throw InvalidParameterValue("Invalid zone name"); + throw invalid_argument("Timetable::get_zone"); unsigned number = lexical_cast(name.substr(space+1)); return train.get_layout().get_zone(name.substr(0, space), number); } @@ -263,7 +263,7 @@ template const T &Timetable::Row::get_param(unsigned i) const { if(i>=params.size()) - throw InvalidParameterValue("Parameter index out of range"); + throw out_of_range("Timetable::Row::get_param"); return params[i].value(); } @@ -402,7 +402,7 @@ Timetable::Row Timetable::Row::parse(const string &s) return Row(ROUTE, s.substr(10)); } - throw InvalidParameterValue("Invalid row"); + throw invalid_argument("Timetable::Row::parse"); }