From 4272db0561aff45f87504c906ba320c3d4d923a7 Mon Sep 17 00:00:00 2001 From: Modulus32 <46051616+Modulus32@users.noreply.github.com> Date: Thu, 25 Apr 2024 21:35:57 -0400 Subject: [PATCH] capture error stack from porttag properly --- TagTool/Commands/Porting/PortTagCommand.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/TagTool/Commands/Porting/PortTagCommand.cs b/TagTool/Commands/Porting/PortTagCommand.cs index 8947c7c8..d80c651c 100644 --- a/TagTool/Commands/Porting/PortTagCommand.cs +++ b/TagTool/Commands/Porting/PortTagCommand.cs @@ -22,6 +22,7 @@ using TagTool.Geometry.BspCollisionGeometry; using TagTool.Commands.ScenarioStructureBSPs; using TagTool.Commands.Files; +using System.Runtime.ExceptionServices; namespace TagTool.Commands.Porting { @@ -319,10 +320,8 @@ public CachedTag ConvertTag(Stream cacheStream, Stream blamCacheStream, Dictiona } catch (Exception e) { - Console.WriteLine(); - Console.WriteLine($"{e.GetType().Name} while porting '{blamTag.Name}.{blamTag.Group.Tag.ToString()}':"); - Console.WriteLine(); - throw e; + new TagToolError(CommandError.CustomError, $"{e.GetType().Name} while porting '{blamTag.Name}.{blamTag.Group.Tag.ToString()}':"); + ExceptionDispatchInfo.Capture(e).Throw(); } #endif PortedTags[blamTag.Index] = result;