[longomatch] Handle exceptions if one addin fails to load



commit ac2e388a7ea6b4dcf4a0d5155aff77975185ec84
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Tue Nov 11 11:57:32 2014 +0100

    Handle exceptions if one addin fails to load

 LongoMatch.Addins/AddinsManager.cs |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/LongoMatch.Addins/AddinsManager.cs b/LongoMatch.Addins/AddinsManager.cs
index 14c82aa..7498fc3 100644
--- a/LongoMatch.Addins/AddinsManager.cs
+++ b/LongoMatch.Addins/AddinsManager.cs
@@ -148,9 +148,13 @@ namespace LongoMatch.Addins
                                foreach (string path in paths) {
                                        foreach (TypeExtensionNode n  in AddinManager.GetExtensionNodes 
(path)) {
                                                var list = plugins.FirstOrDefault (a => a.Key.LocalId == 
n.Addin.Id).Value;
-                                               var instance = n.GetInstance ();
-                                               if (instance is ConfigurablePlugin) {
-                                                       list.Add ((ConfigurablePlugin)instance);
+                                               try {
+                                                       var instance = n.GetInstance ();
+                                                       if (instance is ConfigurablePlugin) {
+                                                               list.Add ((ConfigurablePlugin)instance);
+                                                       }
+                                               } catch (Exception ex) {
+                                                       Log.Exception (ex);
                                                }
                                        }
                                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]