It looks like you're completely recreating the functionality of `failureInFile:...`.  If you match the error name, you can drop the `#ifdef` and just use the new code.