Closed
Bug 830656
Opened 13 years ago
Closed 13 years ago
Lots of _SessionFile.jsm errors when running tests
Categories
(Firefox :: Session Restore, defect)
Firefox
Session Restore
Tracking
()
RESOLVED
FIXED
Firefox 22
People
(Reporter: ttaubert, Assigned: ttaubert)
Details
Attachments
(1 file, 1 obsolete file)
|
1.38 KB,
patch
|
Yoric
:
review+
|
Details | Diff | Splinter Review |
When running tests we seem to often not have a valid session state backup file to remove:
> JavaScript Error: "Uncaught asynchronous error: Unix error 2 during operation remove (No such file or directory) at undefined" {file: "resource:///modules/sessionstore/_SessionFile.jsm" line: 108}
> JavaScript Error: "Could not remove session state backup file: Unix error 2 during operation remove (No such file or directory)" {file: "resource:///modules/sessionstore/_SessionFile.jsm" line: 246}
These are caused by SessionFile.wipe(). I think wipe should not report an error to the console in case the files don't exist. After all that's what we want to achieve when wiping :)
| Assignee | ||
Comment 1•13 years ago
|
||
Comment 3•13 years ago
|
||
Can you use:
} catch (ex if !self._isNoSuchFile(ex)) {
// Nothing
} catch (ex) {
?
| Assignee | ||
Comment 4•13 years ago
|
||
I actually wanted to give that a try because I was quite sure that this works but I didn't really like the empty catch clause in there. Is this really better than the if statement?
Comment 5•13 years ago
|
||
Seems clearer to me (maybe with a more useful comment than "// Nothing"), but I guess I don't feel strongly.
| Assignee | ||
Comment 6•13 years ago
|
||
Incorporated suggestion from comment #5.
Attachment #715140 -
Attachment is obsolete: true
Attachment #715140 -
Flags: review?(dteller)
Attachment #715436 -
Flags: review?(dteller)
Comment 7•13 years ago
|
||
Comment on attachment 715436 [details] [diff] [review]
don't report errors when wipe() tries to remove non-existant session files
Review of attachment 715436 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me, with a possible suggestion.
Oh, and I'm not sure "non-existant" exists in English. Perhaps "non-existent"?
::: browser/components/sessionstore/src/_SessionFile.jsm
@@ +243,2 @@
> }
> +
Why not the following?
catch (ex if self._isNoSuchFile(ex)) {
// Ignore exceptions
} catch (ex) {
Cu.reportError(...);
throw ex;
}
Attachment #715436 -
Flags: review?(dteller) → review+
| Assignee | ||
Comment 8•13 years ago
|
||
(In reply to David Rajchenbach Teller [:Yoric] from comment #7)
> Looks good to me, with a possible suggestion.
> Oh, and I'm not sure "non-existant" exists in English. Perhaps
> "non-existent"?
Oops.
> Why not the following?
>
> catch (ex if self._isNoSuchFile(ex)) {
> // Ignore exceptions
> } catch (ex) {
> Cu.reportError(...);
> throw ex;
> }
Yeah, I like that more. I should've thought of that :)
Comment 9•13 years ago
|
||
(In reply to Tim Taubert [:ttaubert] from comment #8)
> > Why not the following?
> >
> > catch (ex if self._isNoSuchFile(ex)) {
> > // Ignore exceptions
> > } catch (ex) {
> > Cu.reportError(...);
> > throw ex;
> > }
>
> Yeah, I like that more. I should've thought of that :)
Isn't that what I said in comment 3 (minus a typo and a better comment)? o_O
| Assignee | ||
Comment 10•13 years ago
|
||
(In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment #9)
> Isn't that what I said in comment 3 (minus a typo and a better comment)? o_O
Comment 3 has an exclamation mark. Or is that the typo? I assumed your comment was misplaced but probably the exclamation mark was :) Whatever, thanks to you both my patch is now nicer and I'll go ahead and land it.
| Assignee | ||
Comment 11•13 years ago
|
||
| Assignee | ||
Comment 12•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
You need to log in
before you can comment on or make changes to this bug.
Description
•