Closed Bug 511746 Opened 15 years ago Closed 15 years ago

Resource.foo shouldn't throw except in exceptional cases.

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mconnor, Assigned: Mardak)

References

Details

Attachments

(1 file, 2 obsolete files)

Resource.get() throws on 4xx errors.  This seems wrong, and means we have to catch exceptions to handle network errors, and then propagate upwards to the original caller.  We should only throw if something generally unexpected happens.  Auth failures on login almost certainly shouldn't be unexpected as a valid case to handle.
Attached patch v1 (obsolete) — Splinter Review
Also remove usages of lastChannel, etc.
Assignee: nobody → edilee
Status: NEW → ASSIGNED
Attachment #396689 - Flags: review?(thunder)
Blocks: 478330
Blocks: 507433
Attached patch v1.1 (obsolete) — Splinter Review
No more getting down and dirty bit.

It's possible that responses are handled by cache, so there'll be data but no headers, so just use some defaults in that case.
Attachment #396689 - Attachment is obsolete: true
Attachment #396689 - Flags: review?(thunder)
Attachment #396784 - Flags: review?(thunder)
Attached patch v1.2Splinter Review
Updated engines to check for failure and throw.
Attachment #396784 - Attachment is obsolete: true
Attachment #396850 - Flags: review?(thunder)
Attachment #396784 - Flags: review?(thunder)
Comment on attachment 396850 [details] [diff] [review]
v1.2

r=thunder

I love the string hack ;)
Attachment #396850 - Flags: review?(thunder) → review+
http://hg.mozilla.org/labs/weave/rev/bf3db89a4cbd
Get rid of lastChannel and return a String object from _request with additional properties of status, succeeded, headers -- even if the response was handled by cache. Update engines to check for non-success and throw the failure. Update tests to use these additional properties instead of lastChannel, etc.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.6
Blocks: 515678
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: