Skip to content

Commit

Permalink
fix(publish-metrics): throw caught err in step handler (#2368)
Browse files Browse the repository at this point in the history
  • Loading branch information
InesNi authored Dec 14, 2023
1 parent e1606ff commit 67408d1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,13 @@ class OTelPlaywrightTraceReporter extends OTelTraceBase {

await callback();
} catch (err) {
debug('There has been an error during step execution: ', err);
span.recordException(err, Date.now());
span.setStatus({
code: SpanStatusCode.ERROR,
message: err.message
});
debug('There has been an error during step execution:');
throw err;
} finally {
const difference = Date.now() - startTime;
events.emit('histogram', `browser.step.${stepName}`, difference);
Expand Down

0 comments on commit 67408d1

Please sign in to comment.