X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftracktype.cpp;h=c7a6aef7ba70fa85bac12a2ac2c1ff1738cc6a6e;hb=621c5c938d70ba0d155e0eda91a708db0a52c0dc;hp=b6971ca92175badf5cbddbcf772c9a785bc04140;hpb=9bab44d27a89602565270e71d8684fb3f2fac5be;p=r2c2.git diff --git a/source/libr2c2/tracktype.cpp b/source/libr2c2/tracktype.cpp index b6971ca..c7a6aef 100644 --- a/source/libr2c2/tracktype.cpp +++ b/source/libr2c2/tracktype.cpp @@ -55,7 +55,7 @@ bool TrackType::is_dead_end() const const TrackType::Endpoint &TrackType::get_endpoint(unsigned i) const { if(i>=endpoints.size()) - throw InvalidParameterValue("Endpoint index out of range"); + throw out_of_range("TrackType::get_endpoint"); return endpoints[i]; } @@ -63,7 +63,7 @@ const TrackType::Endpoint &TrackType::get_endpoint(unsigned i) const TrackPoint TrackType::get_point(unsigned epi, unsigned path, float d) const { if(epi>=endpoints.size()) - throw InvalidParameterValue("Endpoint index out of range"); + throw out_of_range("TrackType::get_point"); const TrackPart *part = 0; unsigned part_ep = 0; @@ -87,7 +87,7 @@ TrackPoint TrackType::get_point(unsigned epi, unsigned path, float d) const } if(!part) - throw Exception("Internal error (endpoint does not match any part)"); + throw logic_error("internal error (endpoint does not match any part)"); while(1) { @@ -106,7 +106,7 @@ TrackPoint TrackType::get_point(unsigned epi, unsigned path, float d) const d -= plen; TrackPart *next = part->get_link(1-part_ep); if(!next) - throw InvalidParameterValue("Distance out of range"); + throw invalid_argument("TrackType::get_point"); part_ep = (next->get_link(0)==part ? 0 : 1); part = next; }