[banshee] Dap.MassStorage: add logging to empty catch{} blocks



commit b2abfcf43d32a0f125d6f27687f362b6e345a4bf
Author: Nicholas Little <arealityfarbetween googlemail com>
Date:   Tue Jun 3 13:30:24 2014 +0200

    Dap.MassStorage: add logging to empty catch{} blocks
    
    While finding a fix for bug 729438 we have gone through some
    scenarios in which an exception was being thrown, and caught
    by empty catch{} blocks, hiding a regression which would have
    been a bit clear if there was at least some logging in these
    code flows.
    
    So let's add it. If it becomes too noisy, we could still move
    it to only be logged on debug mode, but never logging it looks
    like a mistake.
    
    Signed-off-by: Andrés G. Aragoneses <knocte gmail com>

 .../Banshee.Dap.MassStorage/MassStorageSource.cs   |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MassStorageSource.cs 
b/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MassStorageSource.cs
index 3c54f36..ed15526 100644
--- a/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MassStorageSource.cs
+++ b/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MassStorageSource.cs
@@ -72,7 +72,9 @@ namespace Banshee.Dap.MassStorage
                 if (ms_device.ShouldIgnoreDevice () || !ms_device.LoadDeviceConfiguration ()) {
                     ms_device = null;
                 }
-            } catch {
+            } catch (Exception e) {
+                Log.Exception (e);
+
                 ms_device = null;
             }
 
@@ -673,7 +675,9 @@ namespace Banshee.Dap.MassStorage
             try {
                 SafeUri uri = new SafeUri (command.DeviceId);
                 return BaseDirectory.StartsWith (uri.LocalPath);
-            } catch {
+            } catch (Exception e) {
+                Log.Exception (e);
+
                 return false;
             }
         }


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