← Back to team overview

kicad-developers team mailing list archive

Parse error in one symbol lib prevents subsequent libs loading

 

Hi,

If a symbol library in eeschema fails to load when the libs are
cached, the IO_ERROR rethrown by that curtails the whole process and
subsequent libs don't get cached. This isn't vary fair on poor old
Zilog!

This patch changes a re-thrown IO_ERROR to a wxASSERT_MSG with the
same message, so the user can still see the problem, but can elect to
proceed (or break in their debugger) and load the remaining symbol
libs.

Thanks,

John
From 63f3f172b3b34875e1e9205078b6e44ff3edb597 Mon Sep 17 00:00:00 2001
From: John Beard <john.j.beard@xxxxxxxxx>
Date: Sat, 24 Sep 2016 02:15:41 +0800
Subject: [PATCH] On a failure to cache a symbol lib, don't skip subsequent
 libs

By rethrowing the exception here, the entire caching process is
curtailed if there is an IO_ERROR while parsing a lib. This means any
libs up to the one before the bad one will be cached, but ones after it
wil not be.

Change to wxASSERT_MSG to still present the message to the user, with an
option to abort (/break in a debugger) or continue and load the rest of
the libraries.
---
 eeschema/class_library.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp
index 215477e..3f475fa 100644
--- a/eeschema/class_library.cpp
+++ b/eeschema/class_library.cpp
@@ -1059,7 +1059,7 @@ void PART_LIBS::LoadAllLibraries( PROJECT* aProject ) throw( IO_ERROR, boost::ba
                     GetChars( ioe.What() )
                     );
 
-            THROW_IO_ERROR( msg );
+            wxASSERT_MSG( false, msg );
         }
     }
 
-- 
2.9.3


Follow ups