[PATCH 13/24] dm: core: Correct error handling when event fails