This is an automated email from the ASF dual-hosted git repository.
tompytel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-nodejs.git
The following commit(s) were added to refs/heads/master by this push:
new babf6eb wrapped IORedisPlugin call in try/catch (#58)
babf6eb is described below
commit babf6ebc0022909ef1bb865764045c7ce62c3b1c
Author: Tomasz Pytel <[email protected]>
AuthorDate: Fri Jun 4 10:11:00 2021 -0300
wrapped IORedisPlugin call in try/catch (#58)
---
src/plugins/IORedisPlugin.ts | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/plugins/IORedisPlugin.ts b/src/plugins/IORedisPlugin.ts
index adbd930..626606c 100644
--- a/src/plugins/IORedisPlugin.ts
+++ b/src/plugins/IORedisPlugin.ts
@@ -52,9 +52,17 @@ class IORedisPlugin implements SwPlugin {
span.tag(Tag.dbType('Redis'));
span.tag(Tag.dbInstance(`${this.condition.select}`));
- const ret = wrapPromise(span, _original.apply(this,
args));
- span.async();
- return ret;
+ try {
+ const ret = wrapPromise(span,
_original.apply(this, args));
+ span.async();
+ return ret;
+
+ } catch (err) {
+ span.error(err);
+ span.stop();
+
+ throw err;
+ }
}
}
}