← Back to team overview

kicad-developers team mailing list archive

Re: Parse error in one symbol lib prevents subsequent libs loading

 

Hi Wayne,

Yes, that's a much better idea. The errors can be easily gathered with
wxLogError and are then presented along with any warnings at the end
in a nice interactive way.

The patch is actually no more complex - I was expecting a string
container to be needed!

Cheers,

John


On Sat, Sep 24, 2016 at 2:38 AM, Wayne Stambaugh <stambaughw@xxxxxxxxx> wrote:
> John,
>
> I would prefer that you always show an error when there is an issue
> loading a library rather than only on debug builds.  Please modify your
> patch to collect all load failures and display a message after all of
> the libraries are loaded.  This way the user will always see the
> failure(s) and subsequent libraries will still be loaded in case of a
> failure.
>
> Thanks,
>
> Wayne
>
> On 9/23/2016 2:26 PM, John Beard wrote:
>> 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
>>
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
>>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
From 6d758fa2c236c1d12356ae734331694c12df5337 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 wxLogError to gather the errors to present to the user at the
end of the process.
---
 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..8776e62 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 );
+            wxLogError( msg );
         }
     }
 
-- 
2.9.3


Follow ups

References