Bug 1165861 - Tidy up OSFile error handling in LoopRoomsCache. r=mikedeboer

This commit is contained in:
Mark Banner 2015-05-18 13:52:05 +01:00
parent 07a54c9775
commit da7b1af0b6

View File

@ -81,9 +81,7 @@ LoopRoomsCache.prototype = {
try {
return (this._cache = yield CommonUtils.readJSON(this.path));
} catch(error) {
// This is really complex due to OSFile's error handling, see bug 1160109.
if ((OS.Constants.libc && error.unixErrno != OS.Constants.libc.ENOENT) ||
(OS.Constants.Win && error.winLastError != OS.Constants.Win.ERROR_FILE_NOT_FOUND)) {
if (!error.becauseNoSuchFile) {
MozLoopService.log.debug("Error reading the cache:", error);
}
return (this._cache = {});