@serverless/sdk
Advanced tools
Comparing version 0.5.24 to 0.5.25
@@ -5,2 +5,8 @@ # Changelog | ||
### [0.5.25](https://github.com/serverless/console/compare/@serverless/sdk@0.5.24...@serverless/sdk@0.5.25) (2023-08-16) | ||
### Bug Fixes | ||
- Handle async closures in createSpan correctly ([8c9e03f](https://github.com/serverless/console/commit/8c9e03f15746e71c948e0fe6b3a9bf9c6c15785c)) | ||
### [0.5.24](https://github.com/serverless/console/compare/@serverless/sdk@0.5.23...@serverless/sdk@0.5.24) (2023-08-09) | ||
@@ -7,0 +13,0 @@ |
29
index.js
@@ -70,15 +70,2 @@ 'use strict'; | ||
if (closure && isThenable(closure)) { | ||
return closure.then( | ||
(result) => { | ||
span.close(); | ||
return result; | ||
}, | ||
(error) => { | ||
span.close(); | ||
throw error; | ||
} | ||
); | ||
} | ||
if (closure && isFunction(closure)) { | ||
@@ -88,5 +75,19 @@ let result; | ||
result = closure(); | ||
} finally { | ||
} catch (e) { | ||
span.close(); | ||
throw e; | ||
} | ||
if (isThenable(result)) { | ||
return result.then( | ||
(resolution) => { | ||
span.close(); | ||
return resolution; | ||
}, | ||
(error) => { | ||
span.close(); | ||
throw error; | ||
} | ||
); | ||
} | ||
span.close(); | ||
return result; | ||
@@ -93,0 +94,0 @@ } |
{ | ||
"name": "@serverless/sdk", | ||
"repository": "serverless/console", | ||
"version": "0.5.24", | ||
"version": "0.5.25", | ||
"author": "Serverless, Inc.", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91674
1734