While what you describe is possible, it seems ugly/annoying to have to add that logic to every single run mode that uses my utility method. It would be so much cleaner if I could just replace the currently running run_mode with a new one that handles the error, but I can't figure out how.