Add support for injecting logic on pipeline error/success.