Make really sure we show an error message in case saving failed
ClosedPublic

Authored by broulik on Thu, Apr 25, 2:54 PM.

Details

Summary

When the extension is reloaded, its context is invalidated and any call to an extension API would just throw.
Catch the most important bits of error reporting on save, so you're not left wondering why your settings don't change.

Test Plan

Was working on some settings bits, had to reload the extension often to test things and was always wondering why it didn't do anything when I forgot to also reload the settings page

Now at least I get an error of sorts:

Saving settings failed (Error: Extension context invalidated.)

Diff Detail

Repository
R856 Plasma Browser Integration
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Thu, Apr 25, 2:54 PM
Restricted Application added a project: Plasma. · View Herald TranscriptThu, Apr 25, 2:54 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Thu, Apr 25, 2:54 PM
fvogt requested changes to this revision.Thu, Apr 25, 4:17 PM
fvogt added inline comments.
extension/options.js
174

This should show error as well

This revision now requires changes to proceed.Thu, Apr 25, 4:17 PM
broulik updated this revision to Diff 57019.Fri, Apr 26, 10:37 AM
  • Show error, if any
fvogt accepted this revision.Fri, Apr 26, 11:16 AM
This revision is now accepted and ready to land.Fri, Apr 26, 11:16 AM
This revision was automatically updated to reflect the committed changes.