Catch errors thrown inside the init function