Hardening/issue253

### Description
Generic catch for xml and json parse.
Moved a piece of code outside of try/catch in jsonTreat.