Skip to content

update DebugScope error message#1688

Merged
brettmc merged 2 commits intoopen-telemetry:mainfrom
brettmc:debug-scope-message
Aug 13, 2025
Merged

update DebugScope error message#1688
brettmc merged 2 commits intoopen-telemetry:mainfrom
brettmc:debug-scope-message

Conversation

@brettmc
Copy link
Copy Markdown
Contributor

@brettmc brettmc commented Aug 11, 2025

Make the scope id in error messages consistent between the detached-with-error and not-detached cases, by using spl_object_id($this->scope) in the former to match the latter.

Closes: #1687

Make the scope id in error messages consistent between the detached-with-error and not-detached cases,
by using spl_object_id($this->scope) in the former to match the latter.
@brettmc brettmc requested a review from a team as a code owner August 11, 2025 23:07
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.45%. Comparing base (49aca4a) to head (34c3bef).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1688      +/-   ##
============================================
- Coverage     68.48%   68.45%   -0.04%     
  Complexity     2878     2878              
============================================
  Files           430      430              
  Lines          8759     8757       -2     
============================================
- Hits           5999     5995       -4     
- Misses         2760     2762       +2     
Flag Coverage Δ
8.1 68.21% <100.00%> (+0.04%) ⬆️
8.2 68.29% <100.00%> (-0.06%) ⬇️
8.3 68.31% <100.00%> (+0.01%) ⬆️
8.4 68.34% <100.00%> (+0.04%) ⬆️
8.5 68.34% <100.00%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/Context/DebugScope.php 93.33% <100.00%> (+3.33%) ⬆️

... and 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 49aca4a...34c3bef. Read the comment docs.

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

trigger_error(sprintf(
'Scope: unexpected call to Scope::detach() for scope #%d, scope was already detached %s',
spl_object_id($this),
spl_object_id($this->scope),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think using $this would be more correct, cause as API user you see DebugScope as actual scope.

If you got some bug and start logging spl_object_id($scope), you will get different id's and wold not be able to get sence of what's going on.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, that makes sense. Thanks for the feedback, updated.

@brettmc brettmc merged commit 4274371 into open-telemetry:main Aug 13, 2025
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error in DebugScope "missing call to Scope::detach()" notice

4 participants