Skip to content

Commit fa6f695

Browse files
grantlance
andauthored
Update lib/bindings/http/unmarshaller.js
Co-authored-by: Lance Ball <[email protected]>
1 parent ac40824 commit fa6f695

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/bindings/http/unmarshaller.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,12 @@ class Unmarshaller {
4646

4747
unmarshall(payload, headers) {
4848
return new Promise((resolve, reject) => {
49-
try {
50-
if (!payload) {
51-
throw new TypeError("payload is null or undefined");
52-
}
53-
if (!headers) {
54-
throw new TypeError("headers is null or undefined");
55-
}
49+
if (!payload) {
50+
return reject(new TypeError("payload is null or undefined"));
51+
}
52+
if (!headers) {
53+
return reject(new TypeError("payload is null or undefined"));
54+
}
5655

5756
const sanityHeaders = Commons.sanityAndClone(headers);
5857

0 commit comments

Comments
 (0)