Log in Teardown mixed with global exception log #3161
Unanswered
Tpelleteratbetclic
asked this question in
Q&A
Replies: 2 comments
-
What version of Cake are you using?Are you running on a 32 or 64 bit system?What environment are you running on? Windows? Linux? Mac?Are you running on a CI Server? If so, which one?How Did You Get This To Happen? (Steps to Reproduce or gist to minimal repro) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Not been able to repro, could it be that CI handles stderr and stout differently? I ran this script Task("BOOM")
.Does(() => throw new Exception("BOOM"));
Teardown(ctx => {
for(var i = 1; i <= 15; i++)
{
Information("Teardown {0}", i);
}
});
RunTarget("BOOM"); Output was ========================================
BOOM
========================================
Executing task: BOOM
An error occurred when executing task 'BOOM'.
----------------------------------------
Teardown
----------------------------------------
Executing custom teardown action...
Teardown 1
Teardown 2
Teardown 3
Teardown 4
Teardown 5
Teardown 6
Teardown 7
Teardown 8
Teardown 9
Teardown 10
Teardown 11
Teardown 12
Teardown 13
Teardown 14
Teardown 15
- Error: System.AggregateException: One or more errors occurred. (BOOM)
- ---> System.Exception: BOOM
- at Submission#0.<>c.<<Initialize>>b__0_0() in C:\temp\teardown_errorlog.cake:line 2
- at Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass31_0.<Does>b__0(ICakeContext context) in C:\projects\cake\src\Cake.Core\CakeTaskBuilder.Execution.cs:line 60
- at Cake.Core.CakeTask.Execute(ICakeContext context) in C:\projects\cake\src\Cake.Core\CakeTask.cs:line 125
- at Cake.Core.DefaultExecutionStrategy.ExecuteAsync(CakeTask task, ICakeContext context) in C:\projects\cake\src\Cake.Core\DefaultExecutionStrategy.cs:line 87
- at Cake.Core.CakeEngine.ExecuteTaskAsync(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 336
- at Cake.Core.CakeEngine.ExecuteTaskAsync(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 361
- at Cake.Core.CakeEngine.ExecuteTaskAsync(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 369
- at Cake.Core.CakeEngine.RunTask(ICakeContext context, IExecutionStrategy strategy, CakeTask task, String target, Stopwatch stopWatch, CakeReport report) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 284
- at Cake.Core.CakeEngine.RunTargetAsync(ICakeContext context, IExecutionStrategy strategy, ExecutionSettings settings) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 247
- at Cake.Scripting.BuildScriptHost.RunTargetAsync(String target) in C:\projects\cake\src\Cake\Scripting\BuildScriptHost.cs:line 47
- at Cake.Core.Scripting.ScriptHost.RunTarget(String target) in C:\projects\cake\src\Cake.Core\Scripting\ScriptHost.cs:line 191
- at Submission#0.<<Initialize>>d__0.MoveNext() in C:\temp\priv\teardown_errorlog.cake:line 13
- --- End of stack trace from previous location where exception was thrown ---
- at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult](ImmutableArray`1 precedingExecutors, Func`2 currentExecutor, StrongBox`1 exceptionHolderOpt, Func`2 catchExceptionOpt, CancellationToken cancellationToken)
- at Microsoft.CodeAnalysis.Scripting.Script`1.RunSubmissionsAsync(ScriptExecutionState executionState, ImmutableArray`1 precedingExecutors, Func`2 currentExecutor, Func`2 catchExceptionOpt, CancellationToken cancellationToken)
- --- End of inner exception stack trace ---
- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
- at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
- at Cake.Scripting.Roslyn.RoslynScriptSession.Execute(Script script) in C:\projects\cake\src\Cake\Scripting\Roslyn\RoslynScriptSession.cs:line 136
- at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary`2 arguments) in C:\projects\cake\src\Cake.Core\Scripting\ScriptRunner.cs:line 219
- at Cake.Commands.BuildCommand.Execute(CakeOptions options) in C:\projects\cake\src\Cake\Commands\BuildCommand.cs:line 41
- at Cake.CakeApplication.Run(CakeOptions options) in C:\projects\cake\src\Cake\CakeApplication.cs:line 45
- at Cake.Program.Main() in C:\projects\cake\src\Cake\Program.cs:line 80 Which looks in order to me. Could you please provide more details to aid us in troubleshooting the issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all
We have problem with Cake build log. We log information in Teardown but, if build is failed, logs are mixed with build exception.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions