My refactor caused some changes in error reporting that TestAddDsymCommand.py was checking, so this restores some of the changes to preserve the old behavior.
Putting this through review rather than committing directly because it's one of a couple alternatives discussed, and the affected test is currently XFAILed, so we have time to decide the best way forward.