예제 #1
0
 private static void ThrowIfError(string responseString, IEnumerable <HwiOption> options)
 {
     if (HwiParser.TryParseErrors(responseString, options, out HwiException error))
     {
         throw error;
     }
 }
예제 #2
0
        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;
            }
        }