Skip to content

Commit 46b4bcc

Browse files
committed
fix: fix pr suggestion errors
Signed-off-by: Grant Timmerman <[email protected]>
1 parent fa6f695 commit 46b4bcc

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

lib/bindings/http/unmarshaller.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,22 @@ class Unmarshaller {
5050
return reject(new TypeError("payload is null or undefined"));
5151
}
5252
if (!headers) {
53-
return reject(new TypeError("payload is null or undefined"));
53+
return reject(new TypeError("headers is null or undefined"));
5454
}
5555

56-
const sanityHeaders = Commons.sanityAndClone(headers);
56+
const sanityHeaders = Commons.sanityAndClone(headers);
5757

58-
// Validation level 1
59-
if (!sanityHeaders[Constants.HEADER_CONTENT_TYPE]) {
60-
throw new TypeError("content-type header not found");
61-
}
58+
// Validation level 1
59+
if (!sanityHeaders[Constants.HEADER_CONTENT_TYPE]) {
60+
throw new TypeError("content-type header not found");
61+
}
6262

63-
// Resolve the binding
64-
const bindingName = resolveBindingName(payload, sanityHeaders);
65-
const cloudevent = this.receiverByBinding[bindingName]
66-
.parse(payload, sanityHeaders);
63+
// Resolve the binding
64+
const bindingName = resolveBindingName(payload, sanityHeaders);
65+
const cloudevent = this.receiverByBinding[bindingName]
66+
.parse(payload, sanityHeaders);
6767

68-
resolve(cloudevent);
69-
} catch (e) {
70-
reject(e);
71-
}
68+
resolve(cloudevent);
7269
});
7370
}
7471
}

0 commit comments

Comments
 (0)