* OleDbParameterCollectionTest.cs: Fix compile error in 1.1 profile.
[mono.git] / mcs / class / System.Drawing / System.Drawing.Printing / PrintingServicesUnix.cs
index 9cc0640f5d2a518b2a0e465755f681a53ad5de6e..57cf437bf86b97ba064c779b688d9c577f2285d3 100644 (file)
@@ -118,7 +118,11 @@ namespace System.Drawing.Printing
                                IntPtr ppd_handle = ppdOpenFile (ppd_filename);
                                return ppd_handle;
                        }
-                       catch {
+                       catch (Exception ex) {
+                               Console.WriteLine ("There was an error opening the printer {0}. Please check your cups installation.");
+#if DEBUG
+                               Console.WriteLine (ex.Message);
+#endif
                        }
                        return IntPtr.Zero;
                }
@@ -236,7 +240,9 @@ namespace System.Drawing.Printing
                                        return;
                                }
 
-                               ppd_handle = OpenPrinter (printer);                     
+                               ppd_handle = OpenPrinter (printer);
+                               if (ppd_handle == IntPtr.Zero)
+                                       return;
 
                                printer_dest = (CUPS_DESTS) Marshal.PtrToStructure (ptr, typeof (CUPS_DESTS));
                                options = new NameValueCollection();