Heartbeat vs While loop in Error Handling

so events are basically wrappers for functions that when fired the connects the function each time regardless of its content? events just work this way so the result of a function cant stop the execution of the event? am i getting the logic corrent on events and still dont understand why a while loop would break if it catches an error why cant it just continue to the next iteration?