From 50bb9ce66579c314928dbb822947717f068d5044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20W=C5=82ostowski?= Date: Thu, 27 Jul 2017 14:49:06 +0200 Subject: [PATCH] pcbnew: catch exceptions for missing modules during netlist update to avoid silent failure on first missing footprint --- pcbnew/loadcmp.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pcbnew/loadcmp.cpp b/pcbnew/loadcmp.cpp index a164b5953b..31f64f0721 100644 --- a/pcbnew/loadcmp.cpp +++ b/pcbnew/loadcmp.cpp @@ -337,7 +337,16 @@ MODULE* PCB_BASE_FRAME::loadFootprint( const LIB_ID& aFootprintId ) wxCHECK_MSG( fptbl, NULL, wxT( "Cannot look up LIB_ID in NULL FP_LIB_TABLE." ) ); - MODULE* module = fptbl->FootprintLoadWithOptionalNickname( aFootprintId ); + MODULE *module = nullptr; + try + { + module = fptbl->FootprintLoadWithOptionalNickname( aFootprintId ); + } + catch( const IO_ERROR& ioe ) + { + wxLogDebug( wxT( "An error occurred attemping to load footprint '%s'.\n\nError: %s" ), + aFootprintId.Format().c_str(), GetChars( ioe.What() ) ); + } // If the module is found, clear all net info, // to be sure there is no broken links