File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments