]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/blockiter.cpp
Fix remaining exception class names
[r2c2.git] / source / libr2c2 / blockiter.cpp
index c39f88ed55ca595ac5e67c69d75b995c16ffac80..e662a92ad2020337088d1055d8850c5c0cc93620 100644 (file)
@@ -1,4 +1,3 @@
-#include <msp/core/except.h>
 #include "block.h"
 #include "blockiter.h"
 #include "route.h"
@@ -19,7 +18,7 @@ BlockIter::BlockIter(Block *b, unsigned e):
        _entry(b ? e : 0)
 {
        if(_block && _entry>_block->get_endpoints().size())
-               throw InvalidParameterValue("Endpoint index not valid for block");
+               throw out_of_range("BlockIter::BlockIter");
 }
 
 TrackIter BlockIter::track_iter() const
@@ -34,7 +33,7 @@ TrackIter BlockIter::track_iter() const
 const Block::Endpoint &BlockIter::endpoint() const
 {
        if(!_block)
-               throw InvalidState("BlockIter is null");
+               throw logic_error("null block");
 
        return _block->get_endpoint(_entry);
 }
@@ -47,7 +46,7 @@ int BlockIter::get_exit(const Route *route) const
        while(t_iter)
        {
                if(!_block->has_track(*t_iter))
-                       throw LogicError("Block traversal strayed out of the block");
+                       throw logic_error("internal error (block traversal escaped the block)");
 
                unsigned path = (route ? route->get_path(*t_iter) : t_iter->get_active_path());
                TrackIter t_exit = t_iter.reverse(path);
@@ -105,7 +104,7 @@ BlockIter BlockIter::flip() const
 Block &BlockIter::operator*() const
 {
        if(!_block)
-               throw InvalidState("BlockIter is null");
+               throw logic_error("null block");
 
        return *_block;
 }