Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

fix: restore context when a function run with a given context throws#727

Merged
kjin merged 2 commits intogoogleapis:masterfrom
kjin:cls-new-5
Apr 19, 2018
Merged

fix: restore context when a function run with a given context throws#727
kjin merged 2 commits intogoogleapis:masterfrom
kjin:cls-new-5

Conversation

@kjin
Copy link
Copy Markdown
Contributor

@kjin kjin commented Apr 19, 2018

Addresses a TODO from #708: in two different cases, a function is accepted by the tracing API; we currently do not do any restoration of context if that function throws (in other words, the newly added tests would fail). This PR addresses that.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 19, 2018
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2018

Codecov Report

Merging #727 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #727   +/-   ##
=======================================
  Coverage   90.74%   90.74%           
=======================================
  Files          30       30           
  Lines        1556     1556           
  Branches      304      304           
=======================================
  Hits         1412     1412           
  Misses         61       61           
  Partials       83       83
Impacted Files Coverage Δ
src/cls/async-hooks.ts 95.65% <100%> (ø) ⬆️

Continue to review full report at Codecov.

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

Comment thread src/cls/async-hooks.ts Outdated
return res;
try {
const res = fn();
return res;

This comment was marked as spam.

Copy link
Copy Markdown
Contributor

@ofrobots ofrobots left a comment

Choose a reason for hiding this comment

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

LGTM once the existing nit is addressed.

@kjin kjin merged commit edb8135 into googleapis:master Apr 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants