Skip to content

Rename ObserveException to Catch - #96

Merged
Tyrrrz merged 2 commits into
primefrom
copilot/rename-observeexception-to-catch
Jul 26, 2026
Merged

Rename ObserveException to Catch#96
Tyrrrz merged 2 commits into
primefrom
copilot/rename-observeexception-to-catch

Conversation

Copilot AI commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Renames TaskExtensions.ObserveException() to Catch(). The old name is retained as an [Obsolete] redirect for backward compatibility.

Changes

  • TaskExtensions.cs: Catch() carries the implementation; ObserveException() becomes a one-liner delegate marked [Obsolete("Use Catch() instead.")]
  • TaskExtensionsTests.cs: Test methods updated to exercise Catch()

Usage

// Before
_ = task.ObserveException(); // now obsolete

// After
_ = task.Catch();

@Tyrrrz Tyrrrz added the enhancement New feature or request label Jul 26, 2026
@Tyrrrz
Tyrrrz marked this pull request as ready for review July 26, 2026 20:14
Copilot AI review requested due to automatic review settings July 26, 2026 20:14
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.46%. Comparing base (314fff9) to head (cec915b).

Files with missing lines Patch % Lines
PowerKit/Extensions/TaskExtensions.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            prime      #96      +/-   ##
==========================================
+ Coverage   86.24%   86.46%   +0.22%     
==========================================
  Files          78       78              
  Lines        1410     1411       +1     
  Branches      243      243              
==========================================
+ Hits         1216     1220       +4     
+ Misses        140      138       -2     
+ Partials       54       53       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Renames the Task extension method ObserveException() to Catch() while preserving backward compatibility via an [Obsolete] forwarding wrapper, and updates tests to target the new API name.

Changes:

  • Introduced Catch() as the primary implementation for observing/suppressing unobserved task exceptions.
  • Converted ObserveException() into an [Obsolete("Use Catch() instead.")] one-liner delegate to Catch().
  • Updated TaskExtensionsTests to use Catch() and renamed test methods accordingly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
PowerKit/Extensions/TaskExtensions.cs Adds Catch() implementation and marks ObserveException() obsolete as a redirect.
PowerKit.Tests/Extensions/TaskExtensionsTests.cs Updates tests to call Catch() and renames test methods to match the new API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants