If the meaning of the `encounteredError` variable were flipped, you could use it here instead of `success`.