From 3fe34ea9336a9fdcbade8e24740050b4c9483169 Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Wed, 14 Aug 2019 12:19:57 +0200 Subject: [PATCH] improve output --- src/coverlet.console/Program.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/coverlet.console/Program.cs b/src/coverlet.console/Program.cs index 80b8eec84..378b2f1db 100644 --- a/src/coverlet.console/Program.cs +++ b/src/coverlet.console/Program.cs @@ -1,9 +1,10 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Text; -using System.Threading.Tasks; + using ConsoleTables; using Coverlet.Console.Logging; using Coverlet.Core; @@ -240,6 +241,11 @@ static int Main(string[] args) app.ShowHelp(); return (int)CommandExitCodes.CommandParsingException; } + catch (Win32Exception we) when (we.Source == "System.Diagnostics.Process") + { + logger.LogError($"Start process '{target.Value()}' failed with '{we.Message}'"); + return exitCode > 0 ? exitCode : (int)CommandExitCodes.Exception; + } catch (Exception ex) { logger.LogError(ex.Message);