Skip to content

Commit

Permalink
[dotnet-linker] Improve error reporting by not forgetting about origi…
Browse files Browse the repository at this point in the history
…nal exceptions. (#21464)

This way we report the stack trace of the original exception in build logs.
  • Loading branch information
rolfbjarne authored and haritha-mohan committed Oct 19, 2024
1 parent cbc5746 commit a890a0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/dotnet-linker/Steps/ConfigurationAwareStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,17 @@ bool CollectProductExceptions (Exception e, [NotNullWhen (true)] out List<Produc

protected virtual Exception [] Fail (AssemblyDefinition assembly, Exception e)
{
return CollectExceptions (e, () => ErrorHelper.CreateError (ErrorCode, Errors.MX_ConfigurationAwareStepWithAssembly, Name, assembly?.FullName, e.Message));
return CollectExceptions (e, () => ErrorHelper.CreateError (ErrorCode, e, Errors.MX_ConfigurationAwareStepWithAssembly, Name, assembly?.FullName, e.Message));
}

protected virtual Exception [] Fail (Exception e)
{
return CollectExceptions (e, () => ErrorHelper.CreateError (ErrorCode | 1, Errors.MX_ConfigurationAwareStep, Name, e.Message));
return CollectExceptions (e, () => ErrorHelper.CreateError (ErrorCode | 1, e, Errors.MX_ConfigurationAwareStep, Name, e.Message));
}

protected virtual Exception [] FailEnd (Exception e)
{
return CollectExceptions (e, () => ErrorHelper.CreateError (ErrorCode | 2, Errors.MX_ConfigurationAwareStep, Name, e.Message));
return CollectExceptions (e, () => ErrorHelper.CreateError (ErrorCode | 2, e, Errors.MX_ConfigurationAwareStep, Name, e.Message));
}

Exception [] CollectExceptions (Exception e, Func<ProductException> createException)
Expand Down

0 comments on commit a890a0e

Please sign in to comment.