diff --git a/README.md b/README.md index 563e5078..638299e9 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/opentracing-flowid/README.md b/opentracing-flowid/README.md index a458b44a..fef9d213 100644 --- a/opentracing-flowid/README.md +++ b/opentracing-flowid/README.md @@ -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) diff --git a/opentracing-jdbc/opentracing-jdbc/src/main/java/org/zalando/opentracing/jdbc/TracingQueryExecutionListener.java b/opentracing-jdbc/opentracing-jdbc/src/main/java/org/zalando/opentracing/jdbc/TracingQueryExecutionListener.java index 47e6033c..85e1059a 100644 --- a/opentracing-jdbc/opentracing-jdbc/src/main/java/org/zalando/opentracing/jdbc/TracingQueryExecutionListener.java +++ b/opentracing-jdbc/opentracing-jdbc/src/main/java/org/zalando/opentracing/jdbc/TracingQueryExecutionListener.java @@ -48,14 +48,16 @@ public void beforeQuery(final ExecutionInfo info, final List infos) { public void afterQuery(final ExecutionInfo info, final List 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(); } }