[gbrainy] Better reporting of SVGlib exceptions



commit 71086209f817a4e81a30a0105044c7c52b689f2c
Author: Jordi Mas <jmas softcatala org>
Date:   Sun Nov 6 12:39:48 2011 +0100

    Better reporting of SVGlib exceptions

 src/Core/Libraries/SVGImage.cs |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/Core/Libraries/SVGImage.cs b/src/Core/Libraries/SVGImage.cs
index c855f2d..d8152a4 100644
--- a/src/Core/Libraries/SVGImage.cs
+++ b/src/Core/Libraries/SVGImage.cs
@@ -70,11 +70,15 @@ namespace gbrainy.Core.Libraries
 			
 				handle = rsvg_handle_new_from_data (array, array.Length, out error);
 				rsvg_handle_get_dimensions (handle, ref dimension);
-			} 
+			}
+			catch (Exception e)
+			{
+				Console.WriteLine ("SVGImage. SVGImage (assembly). Exception: {0}", e);
+			}
 			finally
 			{
 				if (handle == IntPtr.Zero)
-					throw new System.IO.IOException ("Resource not found: " + resource);
+					throw new System.IO.IOException ("SVGImage. SVGImage (assembly). Could not load resource: " + resource);
 			}
 		}
 	
@@ -90,11 +94,14 @@ namespace gbrainy.Core.Libraries
 					rsvg_handle_get_dimensions (handle, ref dimension);
 
 			}
-
+			catch (Exception e)
+			{
+				Console.WriteLine ("SVGImage. SVGImage (file). Exception: {0}", e);
+			}
 			finally
 			{
 				if (handle == IntPtr.Zero)
-					throw new System.IO.IOException ("File not found: " + file);
+					throw new System.IO.IOException ("SVGImage. SVGImage (file). Could not load file: " + file);
 
 			}
 		}



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