[Liblas-commits] libpc: throw if sad reader

liblas-commits at liblas.org liblas-commits at liblas.org
Fri Mar 11 17:56:21 EST 2011


details:   http://hg.liblas.orglibpc/rev/44076c9385ab
changeset: 215:44076c9385ab
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Fri Mar 11 14:56:11 2011 -0800
description:
throw if sad reader

diffstat:

 src/drivers/liblas/reader.cpp |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (16 lines):

diff -r 39b2c5e5f985 -r 44076c9385ab src/drivers/liblas/reader.cpp
--- a/src/drivers/liblas/reader.cpp	Fri Mar 11 15:10:46 2011 -0600
+++ b/src/drivers/liblas/reader.cpp	Fri Mar 11 14:56:11 2011 -0800
@@ -270,7 +270,11 @@
     for (i=0; i<numPoints; i++)
     {
         bool ok = m_externalReader->ReadNextPoint();
-        assert(ok); // BUG: add error check
+        if (!ok)
+        {
+            throw libpc_error("liblas reader failed to retrieve point");
+        }
+
         const liblas::Point& pt = m_externalReader->GetPoint();
 
         const boost::int32_t x = pt.GetRawX();


More information about the Liblas-commits mailing list