Closed
Bug 924071
Opened 12 years ago
Closed 12 years ago
Resource's source is null when the resource is an empty file
Categories
(L20n :: JS Library, defect, P1)
L20n
JS Library
Tracking
(Not tracked)
RESOLVED
FIXED
1.0
People
(Reporter: stas, Assigned: stas)
Details
Attachments
(1 file)
|
439 bytes,
patch
|
mgol
:
review+
|
Details | Diff | Splinter Review |
This causes the parser to fail badly in:
function parse(string) {
_source = string;
_index = 0;
_length = _source.length; // <== here
return getLOL();
}
| Assignee | ||
Comment 1•12 years ago
|
||
Michał, does this help?
Attachment #814064 -
Flags: review?(m.goleb+mozilla)
Comment 2•12 years ago
|
||
That seems better since I now have more readable error messages but I still do have ones:
TranslationError {name: "TranslationError", message: "[pl] NationalLibrary: Not found", entity: "NationalLibrary", supportedLocales: Array[1], locale: "pl"…}
l20n.js:1135
RuntimeError {name: "RuntimeError", message: "NationalLibrary: Unable to get translation; tried pl", entity: "NationalLibrary", supportedLocales: Array[1], constructor: function…}
It's caused by the fact that Chrome for some reason returns status code 0 on some l20n files, though if I look later at the network tab I see status 200 so it gets delivered finally, but producing these ugly errors before. :/
Comment 3•12 years ago
|
||
Yeah, that's my worry about switching our IO to use readyState and reacting to code 0. I'd like to get back to using only 200, but that seems to make a mess for local/emulation cases.
Updated•12 years ago
|
OS: Linux → All
Hardware: x86_64 → All
Comment 4•12 years ago
|
||
(In reply to Zbigniew Braniecki [:gandalf] from comment #3)
> Yeah, that's my worry about switching our IO to use readyState and reacting
> to code 0. I'd like to get back to using only 200, but that seems to make a
> mess for local/emulation cases.
What local/emulation cases? Anyway, this needs to be resolved in some way since these errors really flood the console which makes debugging real problems a little harder.
Updated•12 years ago
|
Assignee: nobody → stas
Priority: -- → P1
Target Milestone: --- → 1.0
Comment 5•12 years ago
|
||
Weird enough, I stopped seeing this error in Chrome stable. I do see it in Canary, but it might be a fault of this browser so I'm not sure if there's anything that can be done, unfortunately... :/
Comment 6•12 years ago
|
||
Comment on attachment 814064 [details] [diff] [review]
Empty text is okay
Review of attachment 814064 [details] [diff] [review]:
-----------------------------------------------------------------
This doesn't necessarily remove all the potential errors but makes them bubble up to be handled on a higher level which makes for more readable error messages.
Attachment #814064 -
Flags: review?(m.goleb+mozilla) → review+
| Assignee | ||
Comment 7•12 years ago
|
||
I tried to debug this, and came to a conclusion that this patch fixes a different bug. Hence the change of the bug summary.
For the issue that Michał reported, I think we should file a separate bug and investigate. I tried Chrome Canary but was unable to reproduce status code 0 for the XHRs.
Summary: Resource's source is null when the resource can't be downloaded → Resource's source is null when the resource is an empty file
| Assignee | ||
Comment 8•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•