Skip to content

Commit d924a09

Browse files
committed
[Enhancement] Add more error message from caught exception
1 parent c66f7fa commit d924a09

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

SymlinkCreator/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
5454

55-
[assembly: AssemblyVersion("1.2.5")]
56-
[assembly: AssemblyFileVersion("1.2.5")]
55+
[assembly: AssemblyVersion("1.2.6")]
56+
[assembly: AssemblyFileVersion("1.2.6")]

SymlinkCreator/core/ScriptExecutor.cs

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Diagnostics;
1+
using System;
2+
using System.Diagnostics;
23
using System.IO;
34

45
namespace SymlinkCreator.core
@@ -45,6 +46,18 @@ public void ExecuteAsAdmin()
4546
CreateWrapperScript(wrapperScriptFileName, stderrFileName);
4647
ExecuteWrapperScript(wrapperScriptFileName, stderrFileName);
4748
}
49+
catch (Exception ex)
50+
{
51+
if (StandardError.Length > 0)
52+
{
53+
StandardError += "\n";
54+
}
55+
StandardError += ex.ToString();
56+
if (ExitCode == 0)
57+
{
58+
ExitCode = -1;
59+
}
60+
}
4861
finally
4962
{
5063
File.Delete(wrapperScriptFileName);

0 commit comments

Comments
 (0)