Skip to content

Commit dbc5805

Browse files
mads-hartmannroboquat
authored andcommitted
Don't end all spans when using .fail
1 parent 5c92439 commit dbc5805

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.werft/util/werft.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ export class Werft {
7070
* Use this when you intend to fail the werft job
7171
*/
7272
public fail(slice, err) {
73+
const span = this.sliceSpans[slice];
7374
// Set the status on the span for the slice and also propagate the status to the phase and root span
7475
// as well so we can query on all phases that had an error regardless of which slice produced the error.
75-
[this.sliceSpans[slice], this.rootSpan, this.currentPhaseSpan].forEach((span: Span) => {
76+
[span, this.rootSpan, this.currentPhaseSpan].forEach((span: Span) => {
7677
if (!span) {
7778
return
7879
}
@@ -82,7 +83,7 @@ export class Werft {
8283
})
8384
})
8485

85-
this.endAllSpans()
86+
span.end()
8687

8788
console.log(`[${slice}|FAIL] ${err}`);
8889
throw err;

0 commit comments

Comments
 (0)