]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/tracktype.cpp
Fix remaining exception class names
[r2c2.git] / source / libr2c2 / tracktype.cpp
index b6971ca92175badf5cbddbcf772c9a785bc04140..c7a6aef7ba70fa85bac12a2ac2c1ff1738cc6a6e 100644 (file)
@@ -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;
                }