Refactor onCatch

Change-Id: I8708980f3ffb2708c64b772d832d3e0026ab2ecf