check exitCode first, then parse results