Closed Bug 559678 Opened 16 years ago Closed 16 years ago

Better errors for Storage transactions misuse

Categories

(Core :: SQLite and Embedded Database Bindings, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a4

People

(Reporter: mak, Assigned: mak)

References

Details

Attachments

(1 file, 3 obsolete files)

Attached patch patch v1.0 (obsolete) — — Splinter Review
return NS_ERROR_UNEXPECTED (Shawn prefers this one so we don't have to rev uuid) if a transaction does not exist on COMMIT or ROLLBACK, fix idls (were never updated) and WARN the sqlite error code if it's unknown. I guess Andrew's review is enough here, feel free to forward if i'm wrong please. Thanks.
Attachment #439370 - Flags: review?(bugmail)
Comment on attachment 439370 [details] [diff] [review] patch v1.0 Should you be using NS_LITERAL_CSTRING for your error message? Assuming Shawn has signed off on the error changes, my review probably works? In general I think you want to direct all reviews to sdwilsh, though.
Attachment #439370 - Flags: review?(bugmail) → review+
(In reply to comment #1) > Assuming Shawn has signed off on the error changes, my review probably works? > In general I think you want to direct all reviews to sdwilsh, though. You are a peer ;)
(In reply to comment #1) > (From update of attachment 439370 [details] [diff] [review]) > Should you be using NS_LITERAL_CSTRING for your error message? good question, i see in code we use both forms, i guess Append has overloads, i'm unsure what's the "cheapest" one, not that i care much since this is debug only and pretty rare.
Attached patch patch v1.1 (obsolete) — — Splinter Review
Gavin suggested AppendLiteral, that works too, since he's more experienced, i'll just go for it.
Attachment #439370 - Attachment is obsolete: true
Attached patch patch v1.2 (obsolete) — — Splinter Review
maybe attach the right patch, eh? :)
Attachment #439380 - Attachment is obsolete: true
Attached patch patch v1.3 — — Splinter Review
yay! Looks like Storage had a test for this exception, fixed it to check NS_ERROR_UNEXPECTED.
Attachment #439381 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a4
Blocks: 558218
Blocks: 557525
Blocks: 557430
Blocks: 555014
Blocks: 537347
i'll push a followup to use better (less scarying) wording in the warning.
(In reply to comment #8) > i'll push a followup to use better (less scarying) wording in the warning. Thanks mak!
Product: Toolkit → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: