Add a "printf only on failure" event handler.