Move all application initialisation code inside @try block.