[PATCH v2 12/23] dm: core: Correct error handling when event fails