Closed Bug 1414995 Opened 2 years ago Closed 2 years ago

Throw when publicsuffixlist cannot be opened

Categories

(Firefox for Android :: Activity Stream, enhancement)

All
Android
enhancement
Not set

Tracking

()

RESOLVED FIXED
Firefox 58
Tracking Status
firefox58 --- fixed

People

(Reporter: mcomella, Assigned: mcomella)

References

Details

Attachments

(1 file)

Right now we swallow the error which produces an unexpected UI (and could be worse, e.g. if we save this output to disk in the future).

This file is bundled with the APK so there's never a good reason we shouldn't be able to open it: I think we should crash if we can't open it.

Before landing this fix, we'll have to make sure the unit tests that are failing are fixed (bug # pending, see bug 1409087 comment 25 and later).

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1409087#c25
Comment on attachment 8925734 [details]
Bug 1414995: Crash when publicsuffixlist could not be opened.

https://reviewboard.mozilla.org/r/196878/#review202158

::: mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/publicsuffix/PublicSuffixPatterns.java:42
(Diff revision 1)
>              while ((line = reader.readLine()) != null) {
>                  EXACT.add(line);
>              }
>  
>          } catch (IOException e) {
> -            Log.e("Patterns", "IOException during loading public suffix list");
> +            throw new IllegalStateException("resource publicsuffixlist could not be opened but is bundled with app");

You probably want to pass in `e` to ISE's constructor, as well.
Comment on attachment 8925734 [details]
Bug 1414995: Crash when publicsuffixlist could not be opened.

https://reviewboard.mozilla.org/r/196878/#review203302
Attachment #8925734 - Flags: review?(cnevinchen) → review+
Pushed by michael.l.comella@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/7e505b1a27ad
Crash when publicsuffixlist could not be opened. r=nechen
https://hg.mozilla.org/mozilla-central/rev/7e505b1a27ad
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
You need to log in before you can comment on or make changes to this bug.