Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions TUnit.Engine/Services/HookExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async ValueTask ExecuteBeforeTestSessionHooksAsync(CancellationToken canc
ExceptionDispatchInfo.Capture(skipEx).Throw();
}

throw new BeforeTestSessionException("BeforeTestSession hook failed", ex);
throw new BeforeTestSessionException($"BeforeTestSession hook failed: {ex.Message}", ex);
}
}
}
Expand All @@ -83,7 +83,7 @@ public async ValueTask<List<Exception>> ExecuteAfterTestSessionHooksAsync(Cancel
{
// Collect hook exceptions instead of throwing immediately
// This allows all hooks to run even if some fail
exceptions.Add(new AfterTestSessionException("AfterTestSession hook failed", ex));
exceptions.Add(new AfterTestSessionException($"AfterTestSession hook failed: {ex.Message}", ex));
}
}

Expand Down Expand Up @@ -119,7 +119,7 @@ public async ValueTask ExecuteBeforeAssemblyHooksAsync(Assembly assembly, Cancel
ExceptionDispatchInfo.Capture(skipEx).Throw();
}

throw new BeforeAssemblyException("BeforeAssembly hook failed", ex);
throw new BeforeAssemblyException($"BeforeAssembly hook failed: {ex.Message}", ex);
}
}
}
Expand All @@ -146,7 +146,7 @@ public async ValueTask<List<Exception>> ExecuteAfterAssemblyHooksAsync(Assembly
{
// Collect hook exceptions instead of throwing immediately
// This allows all hooks to run even if some fail
exceptions.Add(new AfterAssemblyException("AfterAssembly hook failed", ex));
exceptions.Add(new AfterAssemblyException($"AfterAssembly hook failed: {ex.Message}", ex));
}
}

Expand Down Expand Up @@ -184,7 +184,7 @@ public async ValueTask ExecuteBeforeClassHooksAsync(
ExceptionDispatchInfo.Capture(skipEx).Throw();
}

throw new BeforeClassException("BeforeClass hook failed", ex);
throw new BeforeClassException($"BeforeClass hook failed: {ex.Message}", ex);
}
}
}
Expand Down Expand Up @@ -213,7 +213,7 @@ public async ValueTask<List<Exception>> ExecuteAfterClassHooksAsync(
{
// Collect hook exceptions instead of throwing immediately
// This allows all hooks to run even if some fail
exceptions.Add(new AfterClassException("AfterClass hook failed", ex));
exceptions.Add(new AfterClassException($"AfterClass hook failed: {ex.Message}", ex));
}
}

Expand Down Expand Up @@ -248,7 +248,7 @@ public async ValueTask ExecuteBeforeTestHooksAsync(AbstractExecutableTest test,
ExceptionDispatchInfo.Capture(skipEx).Throw();
}

throw new BeforeTestException("BeforeEveryTest hook failed", ex);
throw new BeforeTestException($"BeforeEveryTest hook failed: {ex.Message}", ex);
}
}
}
Expand Down Expand Up @@ -277,7 +277,7 @@ public async ValueTask ExecuteBeforeTestHooksAsync(AbstractExecutableTest test,
ExceptionDispatchInfo.Capture(skipEx).Throw();
}

throw new BeforeTestException("BeforeTest hook failed", ex);
throw new BeforeTestException($"BeforeTest hook failed: {ex.Message}", ex);
}
}
}
Expand Down Expand Up @@ -347,7 +347,7 @@ public async ValueTask ExecuteBeforeTestDiscoveryHooksAsync(CancellationToken ca
}
catch (Exception ex)
{
throw new BeforeTestDiscoveryException("BeforeTestDiscovery hook failed", ex);
throw new BeforeTestDiscoveryException($"BeforeTestDiscovery hook failed: {ex.Message}", ex);
}
}
}
Expand All @@ -370,7 +370,7 @@ public async ValueTask ExecuteAfterTestDiscoveryHooksAsync(CancellationToken can
}
catch (Exception ex)
{
throw new AfterTestDiscoveryException("AfterTestDiscovery hook failed", ex);
throw new AfterTestDiscoveryException($"AfterTestDiscovery hook failed: {ex.Message}", ex);
}
}
}
Expand Down
Loading