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 {
50
50
return reject ( new TypeError ( "payload is null or undefined" ) ) ;
51
51
}
52
52
if ( ! headers ) {
53
- return reject ( new TypeError ( "payload is null or undefined" ) ) ;
53
+ return reject ( new TypeError ( "headers is null or undefined" ) ) ;
54
54
}
55
55
56
- const sanityHeaders = Commons . sanityAndClone ( headers ) ;
56
+ const sanityHeaders = Commons . sanityAndClone ( headers ) ;
57
57
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
+ }
62
62
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 ) ;
67
67
68
- resolve ( cloudevent ) ;
69
- } catch ( e ) {
70
- reject ( e ) ;
71
- }
68
+ resolve ( cloudevent ) ;
72
69
} ) ;
73
70
}
74
71
}
You can’t perform that action at this time.
0 commit comments