move exception resuming into a dedicated function