Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception Message should be shown rather than "One or more errors occurred." #1815

Closed
joshclark opened this issue Sep 20, 2017 · 6 comments · Fixed by #1824
Closed

Exception Message should be shown rather than "One or more errors occurred." #1815

joshclark opened this issue Sep 20, 2017 · 6 comments · Fixed by #1824
Assignees
Labels
Milestone

Comments

@joshclark
Copy link

What You Are Seeing?

Exception messages are not displayed. Instead "One or more errors occurred." is shown as the error message.

What is Expected?

When an exception is thrown with a specific error message, I would expect to see that that text in the console output.

What version of Cake are you using?

Version 0.22.2+Branch.main.Sha.c8630875bc14ce11aa758e0dcd55f691da5f602b

Are you running on a 32 or 64 bit system?

64 bit Windows

What environment are you running on? Windows? Linux? Mac?

64 bit Windows

Are you running on a CI Server? If so, which one?

No. Command line

How Did You Get This To Happen? (Steps to Reproduce)

  1. test.cake:
Task("Default")
  .Does(() =>
{
  throw new Exception("Foo");
});

RunTarget("Default");
  1. Run cake: Cake test.cake

  2. Output:

========================================
Default
========================================
An error occurred when executing task 'Default'.
Error: One or more errors occurred.
@SIkebe
Copy link
Contributor

SIkebe commented Sep 22, 2017

I have same problem.
Exception is printed as below when you use netcoreapp1.0 as TargetFrameworks of Cake.exe, but not when net461
error-netcoreapp1 0
.

@patriksvensson
Copy link
Member

The phrase One of more errors occured is the message part of an AggregateException, so I suspect this has to do with this change that was introduced recently.

@devlead
Copy link
Member

devlead commented Sep 22, 2017

Ah probably I can take a look at sorting that.

@devlead devlead self-assigned this Sep 22, 2017
@devlead devlead added the Bug label Sep 22, 2017
@devlead devlead added this to the v0.23.0 milestone Sep 22, 2017
devlead added a commit to devlead/cake that referenced this issue Sep 24, 2017
devlead added a commit to devlead/cake that referenced this issue Sep 24, 2017
devlead added a commit to devlead/cake that referenced this issue Sep 24, 2017
devlead added a commit to devlead/cake that referenced this issue Sep 24, 2017
devlead added a commit to devlead/cake that referenced this issue Sep 24, 2017
@dracan
Copy link
Contributor

dracan commented Sep 25, 2017

I've just been getting this, and wasn't sure what the exception actually was. So I temporarily handled it in a try catch block to dump out the output.

Obviously only a temporary solution until this issue is fixed, but I thought it worth pasting the code here in case anyone else saw this ticket and didn't know what their exception was either ...

try
{
    // Some code
}
catch(AggregateException aex)
{
    aex.Handle(ex => { Console.WriteLine(ex.ToString()); return false; });
}

Hopefully this'll be resolved soon, as that's obviously bloat in my Cake file! :)

@devlead
Copy link
Member

devlead commented Sep 25, 2017

@dracan running cake with diagnostic verbosity will give the full stack trace too.

@dracan
Copy link
Contributor

dracan commented Sep 25, 2017

@devlead Ah, cool - I had tried verbose, but not diagnostic.

devlead added a commit to devlead/cake that referenced this issue Sep 26, 2017
devlead added a commit to devlead/cake that referenced this issue Sep 26, 2017
devlead added a commit to devlead/cake that referenced this issue Sep 26, 2017
devlead added a commit to devlead/cake that referenced this issue Sep 26, 2017
bjorkstromm added a commit that referenced this issue Sep 26, 2017
GH1815: Log inner exceptions message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants