Skip to content

Commit

Permalink
Added try-finally to span finish
Browse files Browse the repository at this point in the history
  • Loading branch information
whiskeysierra committed Nov 26, 2019
1 parent 8070e93 commit d28f7cf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![Build Status](https://github.com/zalando/opentracing-toolbox/workflows/Test/badge.svg)
[![Stability: Active](https://masterminds.github.io/stability/active.svg)](https://masterminds.github.io/stability/active.html)
[![Coverage Status](https://img.shields.io/coveralls/zalando/opentracing-toolbox/master.svg)](https://coveralls.io/r/zalando/opentracing-toolbox)
[![Code Quality](https://img.shields.io/codacy/grade/213bb62c41b34a32951929e37a2d20ac/master.svg)](https://www.codacy.com/app/whiskeysierra/opentracing-toolbox)
[![Code Quality](https://img.shields.io/codacy/grade/69e173024eec403797466e147a2051a3/master.svg)](https://www.codacy.com/app/whiskeysierra/opentracing-toolbox)
[![Release](https://img.shields.io/github/release/zalando/opentracing-toolbox.svg)](https://github.com/zalando/opentracing-toolbox/releases)
[![Maven Central](https://img.shields.io/maven-central/v/org.zalando/opentracing-toolbox.svg)](https://maven-badges.herokuapp.com/maven-central/org.zalando/opentracing-toolbox)
[![OpenTracing](https://img.shields.io/badge/OpenTracing-enabled-blue.svg)](http://opentracing.io)
Expand Down
2 changes: 1 addition & 1 deletion opentracing-flowid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![Build Status](https://github.com/zalando/opentracing-toolbox/workflows/Test/badge.svg)
[![Coverage Status](https://img.shields.io/coveralls/zalando/opentracing-toolbox/master.svg)](https://coveralls.io/r/zalando/opentracing-toolbox)
[![Code Quality](https://img.shields.io/codacy/grade/213bb62c41b34a32951929e37a2d20ac/master.svg)](https://www.codacy.com/app/whiskeysierra/opentracing-toolbox)
[![Code Quality](https://img.shields.io/codacy/grade/69e173024eec403797466e147a2051a3/master.svg)](https://www.codacy.com/app/whiskeysierra/opentracing-toolbox)
[![Javadoc](http://javadoc.io/badge/org.zalando/opentracing-flowid.svg)](http://www.javadoc.io/doc/org.zalando/opentracing-flowid)
[![Release](https://img.shields.io/github/release/zalando/opentracing-toolbox.svg)](https://github.com/zalando/opentracing-toolbox/releases)
[![Maven Central](https://img.shields.io/maven-central/v/org.zalando/opentracing-toolbox.svg)](https://maven-badges.herokuapp.com/maven-central/org.zalando/opentracing-toolbox)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ public void beforeQuery(final ExecutionInfo info, final List<QueryInfo> infos) {
public void afterQuery(final ExecutionInfo info, final List<QueryInfo> queries) {
final Span span = info.getCustomValue(SPAN, Span.class);

if (!info.isSuccess()) {
final Statement statement = info.getStatement();
final Throwable error = info.getThrowable();

decorator.onError(span, statement, error);
try {
if (!info.isSuccess()) {
final Statement statement = info.getStatement();
final Throwable error = info.getThrowable();

decorator.onError(span, statement, error);
}
} finally {
span.finish();
}

span.finish();
}

}

0 comments on commit d28f7cf

Please sign in to comment.