Closed
Bug 665217
Opened 15 years ago
Closed 15 years ago
Login Manager can throw the wrong exception on failures
Categories
(Toolkit :: Password Manager, defect)
Toolkit
Password Manager
Tracking
()
RESOLVED
FIXED
mozilla7
People
(Reporter: zpao, Assigned: jaws)
Details
Attachments
(1 file)
|
9.95 KB,
patch
|
zpao
:
review+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #580839 +++
From bug 552828 comment 12:
> > > } catch (e) {
> > > this.log("getExistingEntryID failed: " + e);
> > > throw e;
> > > } finally {
> > >- stmt.reset();
> > >+ if (stmt)
> > >+ stmt.reset();
> > > }
> >
> > What's this change for?
>
> dbCreateStatement managed to return null or throw once for me and I saw an
> error message, so I added the check.
Indeed, if an exception occurs in the |finally|, callers see that instead of the intended |throw e| from the |catch|. We should fix all the cases in satchel where this pattern exists (and in pwmgr, if it's there?) to test |stmt| before trying to reset it.
This won't be a functional change, because there shouldn't be any callers that depend on specific exceptions (afaik), but it would be helpful for debugging.
- - -
This is all over login manager (storage-mozStorage.js) too. Jared, want to tackle that too?
| Assignee | ||
Updated•15 years ago
|
Assignee: nobody → jwein
Status: NEW → ASSIGNED
| Assignee | ||
Comment 1•15 years ago
|
||
I've replaced all the unchecked stmt.reset() lines with the extra guard around them.
There are quite a few other files that might need this similar change. Should we go ahead and just create bugs for all of those?
Attachment #540554 -
Flags: review?(paul)
| Assignee | ||
Comment 2•15 years ago
|
||
Try submission: http://tbpl.mozilla.org/?tree=Try&rev=5f940047dbf1
| Reporter | ||
Comment 3•15 years ago
|
||
Comment on attachment 540554 [details] [diff] [review]
Patch for bug 665217
Review of attachment 540554 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good
Attachment #540554 -
Flags: review?(paul) → review+
| Reporter | ||
Comment 4•15 years ago
|
||
(In reply to comment #1)
> There are quite a few other files that might need this similar change.
> Should we go ahead and just create bugs for all of those?
Yea, you can get those filed in the right components if you'd like. It doesn't seem like the most pressing issue (it's been ~3 years since password manager started using sqlite without problems that we know of).
| Reporter | ||
Comment 6•15 years ago
|
||
If somebody doesn't get to it before me, I'll land it with some patches I have ready to go.
| Reporter | ||
Updated•15 years ago
|
Keywords: checkin-needed
Whiteboard: [inbound]
Comment 7•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla7
You need to log in
before you can comment on or make changes to this bug.
Description
•