Added try/catch #5427

One last nit: the indentation is incorrect here, please revert this change.