Bug 1412756 - Do not throw exceptions when the 'Crash Reports/pending' directory is missing; r=mconley
authorGabriele Svelto <gsvelto@mozilla.com>
Mon, 30 Oct 2017 12:24:39 +0100
changeset 442953 43d073ce0141c76543cdcfcc13663a93715cdcbd
parent 442952 a34d7e519961b5dd49ec156e5f5b1b5bc548122a
child 442954 8e247550d6cf4ee040564ecced15bca47715b3b5
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1412756
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1412756 - Do not throw exceptions when the 'Crash Reports/pending' directory is missing; r=mconley MozReview-Commit-ID: 2tFfgiGeGSl
toolkit/crashreporter/CrashSubmit.jsm
--- a/toolkit/crashreporter/CrashSubmit.jsm
+++ b/toolkit/crashreporter/CrashSubmit.jsm
@@ -486,24 +486,24 @@ this.CrashSubmit = {
   pendingIDs: async function CrashSubmit_pendingIDs(minFileDate) {
     let ids = [];
     let dirIter = null;
     let pendingDir = getDir("pending");
 
     try {
       dirIter = new OS.File.DirectoryIterator(pendingDir);
     } catch (ex) {
-      if (ex.becauseNoSuchFile) {
-        return ids;
-      }
-
       Cu.reportError(ex);
       throw ex;
     }
 
+    if (!(await dirIter.exists())) {
+      return ids;
+    }
+
     try {
       let entries = Object.create(null);
       let ignored = Object.create(null);
 
       // `await` in order to ensure all callbacks are called
       await dirIter.forEach(entry => {
         if (!entry.isDir /* is file */) {
           let matches = entry.name.match(/(.+)\.dmp$/);