HomePhabricator

resourceloader: Throw exception when config serialization fails

Description

resourceloader: Throw exception when config serialization fails

If something puts a string that's invalid UTF-8 in a JS config variable,
JSON serialization will fail on the entire config blob. Currently, this
causes the entire config blob to be silently dropped, which breaks all
JavaScript because elementary variables like wgPageName are missing.

This change makes this scenario fail loudly rather than quietly, by
throwing an exception. This also makes bugs like these easier to track
down.

Bug: T206475
Change-Id: Ief2ae00228389a23627d440dc1cd9a54cf2b6926

Details

Provenance
CatropeAuthored on Oct 9 2018, 8:43 PM
KrinkleCommitted on Oct 11 2018, 9:08 PM
Parents
rMW329f0cfb6c24: Merge "Use <div> wrappers instead of <p> in ProtectionForm"
Branches
Unknown
Tags
Unknown
ChangeId
Ief2ae00228389a23627d440dc1cd9a54cf2b6926