Fixed #21962 -- Added a flag to ErrorDict.as_json() to escape html