mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 1416251 - Remove conditional catch consumers in mobile/android/. r=nechen
This commit is contained in:
parent
fd27c36b82
commit
2efac753f7
@ -4477,14 +4477,20 @@ Tab.prototype = {
|
||||
let originHost = "";
|
||||
try {
|
||||
originHost = Services.io.newURI(appOrigin).host;
|
||||
} catch (e if (e.result == Cr.NS_ERROR_FAILURE)) {
|
||||
} catch (e) {
|
||||
if (e.result != Cr.NS_ERROR_FAILURE) {
|
||||
throw e;
|
||||
}
|
||||
// NS_ERROR_FAILURE can be thrown by nsIURI.host if the URI scheme does not possess a host -
|
||||
// in this case we just act as if we have an empty host.
|
||||
}
|
||||
let locationHost = "";
|
||||
try {
|
||||
locationHost = aLocationURI.host;
|
||||
} catch (e if (e.result == Cr.NS_ERROR_FAILURE)) {
|
||||
} catch (e) {
|
||||
if (e.result != Cr.NS_ERROR_FAILURE) {
|
||||
throw e;
|
||||
}
|
||||
// Ditto.
|
||||
}
|
||||
if (originHost != locationHost || originHost == "") {
|
||||
|
@ -265,7 +265,10 @@ function writeStat(snippetId, timestamp) {
|
||||
} finally {
|
||||
yield file.close();
|
||||
}
|
||||
} catch (ex if ex instanceof OS.File.Error && ex.becauseNoSuchFile) {
|
||||
} catch (ex) {
|
||||
if (!(ex instanceof OS.File.Error && ex.becauseNoSuchFile)) {
|
||||
throw ex;
|
||||
}
|
||||
// If the file doesn't exist yet, create it.
|
||||
yield OS.File.writeAtomic(gStatsPath, data, { tmpPath: gStatsPath + ".tmp" });
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user