Now that {T315481} is merged, any errors that occur within Phonos will break parsing/saving of the entire page. We should catch the ones we know are unrecoverable (those all //should// be `PhonosException`s, and if they're not, we need to add them). For now the output can simply be what the error message is, except localized which we haven't implemented yet.
**Types of fatal errors** (for QA purposes)
* When eSpeak fails (i.e. set `$wgPhonosEspeak = '/invalid';`)
* When Larynx fails (i.e. set `$wgPhonosApiEndpointLarynx = 'https://example.org';`)
* When Google fails (i.e. set `$wgPhonosApiKeyGoogle = 'foobar';`)
* When Lame fails (i.e. set `$wgPhonosLame = '/invalid';` – there's actually a unit test for this one)
* When Phonos can't create the storage directory (try changing `$wgPhonosPath = '/tmp/directory-with-no-write-permissions';` -- just don't do something that breaks your system)
* When Phonos can't create the file in the storage directory (remove write permissions on the directory)
**Acceptance criteria**
* All known fatal exceptions should be captured, with localized messages displayed to the user
* Place the page in a [[ https://www.mediawiki.org/wiki/Help:Tracking_categories | tracking category ]] called `Pages with Phonos rendering errors`
* Designs use the standard `Html::errorBox()` as provided my MediaWiki
* Recoverable errors such as a missing file via `file=` parameter should not prevent Phonos from outputting the button as usual (as we have user-friendly error messages for that)
* Errors are tracked in [[ https://wikitech.wikimedia.org/wiki/Statsd | Statsd ]], given we're capturing the exceptions thus they won't show up in Logstash (//no idea how to QA this, but I followed Extension:Score's example//)
** !!//Not sure if we should be using [[ https://wikitech.wikimedia.org/wiki/Prometheus | Prometheus ]] instead?//!!