Skip to content

Commit 6ffcbc4

Browse files
committed
fix(dotnet): include stacktrace in the error report
1 parent 52f5731 commit 6ffcbc4

File tree

1 file changed

+4
-4
lines changed
  • ffi/dotnet/Devolutions.IronRdp.ConnectExample

1 file changed

+4
-4
lines changed

ffi/dotnet/Devolutions.IronRdp.ConnectExample/Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static async Task Main(string[] args)
6868
}
6969
catch (Exception e)
7070
{
71-
Console.WriteLine($"An error occurred: {e.Message}");
71+
Console.WriteLine($"An error occurred: {e.Message}\n\nStackTrace:\n{e.StackTrace}");
7272
}
7373
}
7474

@@ -80,13 +80,15 @@ private static void saveImage(DecodedImage decodedImage, string v)
8080

8181
var bytes = new byte[data.GetSize()];
8282
data.Fill(bytes);
83+
8384
for (int i = 0; i < bytes.Length; i += 4)
8485
{
8586
byte temp = bytes[i]; // Store the original Blue value
8687
bytes[i] = bytes[i + 2]; // Move Red to Blue's position
8788
bytes[i + 2] = temp; // Move original Blue to Red's position
8889
// Green (bytes[i+1]) and Alpha (bytes[i+3]) remain unchanged
8990
}
91+
9092
#if WINDOWS // Bitmap is only available on Windows
9193
using (var bmp = new Bitmap(width, height))
9294
{
@@ -176,8 +178,6 @@ static void PrintHelp()
176178
Console.WriteLine(" --help Show this message and exit.");
177179
}
178180

179-
180-
181181
private static Config buildConfig(string servername, string username, string password, string domain, int width, int height)
182182
{
183183
ConfigBuilder configBuilder = ConfigBuilder.New();
@@ -193,4 +193,4 @@ private static Config buildConfig(string servername, string username, string pas
193193
}
194194

195195
}
196-
}
196+
}

0 commit comments

Comments
 (0)