Closed Bug 1306033 Opened 3 years ago Closed 3 years ago
_ENSURE _SUCCESS(rv, rv) failed with NS _ERROR _NOT _AVAILABLE: file netwerk/cache2/Cache Entry .cpp, line 1151
Every time the alternate data is not available, NS_ENSURE_SUCCESS produces a warning. This would produce warnings for every load where an alternative data type is preferred, for the first visit and for any script where we are unable to produce alternate data for. I suggest to manually filter out NS_ERROR_NOT_AVAILABLE before calling NS_ENSURE_SUCCESS.
As unavailable alternate data type is a common, expected, and supported case, we should not produce a warning for such issues. This patch filters out the unavailable error before the use of NS_ENSURE_SUCCESS macro.
Attachment #8795773 - Flags: review?(valentin.gosu)
Assignee: nobody → nicolas.b.pierron
Comment on attachment 8795773 [details] [diff] [review] Explicitly filter out unavailable alternate data type errors. Review of attachment 8795773 [details] [diff] [review]: ----------------------------------------------------------------- Honza, is this OK, or are we better off replacing NS_ENSURE with if (NS_FAILED(rv)) return rv?
Attachment #8795773 - Flags: review?(valentin.gosu) → review?(honzab.moz)
Attachment #8795773 - Flags: review?(honzab.moz)
Failure of call to CacheEntry::OpenAlternativeInputStream with NS_ERROR_NOT_AVAILABLE is legal. The patch as suggested deletes warnings that we may want to log. I will take this bug and have a patch that should preserve console warnings in some cases that might be useful to have.
Assignee: nicolas.b.pierron → honzab.moz
Status: NEW → ASSIGNED
Michal, this is what I think is worth to spit to the console, but feel free to suggest changes.
Attachment #8796180 - Flags: review?(michal.novotny) → review+
(no need for a try run, this only changes few warning prints to the console)
Pushed by email@example.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/06cb6118fd79 Only fatal console warnings on failures of OpenAlternativeInputStream in HTTP cache. r=michal
You need to log in before you can comment on or make changes to this bug.