private static void ThrowIfError(string responseString, IEnumerable <HwiOption> options) { if (HwiParser.TryParseErrors(responseString, options, out HwiException error)) { throw error; } }
private static void ThrowIfError(string responseString, IEnumerable <HwiOption> options, string arguments, int exitCode) { if (exitCode != 0) { if (HwiParser.TryParseErrors(responseString, options, out HwiException error)) { throw error; } throw new HwiException(HwiErrorCode.UnknownError, $"'hwi {arguments}' exited with incorrect exit code: {exitCode}."); } if (HwiParser.TryParseErrors(responseString, options, out HwiException error2)) { throw error2; } }