Ignore (mostly false) upload errors (Picasa)
authortools.yifeibot <tools.yifeibot@tools-dev.eqiad.wmflabs>
Wed, 27 Aug 2014 09:00:19 +0000 (09:00 +0000)
committertools.yifeibot <tools.yifeibot@tools-dev.eqiad.wmflabs>
Wed, 27 Aug 2014 09:00:19 +0000 (09:00 +0000)
o/prb/Picasa-Review-Bot/Program.cs

index 1317a72..57a30a5 100644 (file)
@@ -303,9 +303,16 @@ namespace PicasaReview
                 if (!alreadyUploaded && !wikiBitmapIsBigger)
                 {
                     string saveText = page.text;
-                    page.UploadImage(picasaImageFilename,
-                                     "Uploading version from source, revert me if incorrect",
-                                     "", "", "");
+                    try
+                    {
+                        page.UploadImage(picasaImageFilename,
+                                         "Uploading version from source, revert me if incorrect",
+                                         "", "", "");
+                    }
+                    catch (WikiBotException e)
+                    {
+                        Console.WriteLine("Upload failed"); // Just ignore upload errors
+                    }
                     // Set back to current wikitext
                     page.Load();
                     page.text = saveText;