File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 11use serde:: Deserialize ;
22
33/// Request tracing information
4- #[ derive( Debug , Deserialize ) ]
4+ #[ derive( Debug , Default , Deserialize ) ]
55#[ serde( rename_all = "camelCase" ) ]
66pub struct Tracing {
77 /// The type of tracing exposed to the extension
@@ -20,6 +20,7 @@ pub struct InvokeEvent {
2020 /// The function's Amazon Resource Name
2121 pub invoked_function_arn : String ,
2222 /// The request tracing information
23+ #[ serde( default ) ]
2324 pub tracing : Tracing ,
2425}
2526
Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ where
272272 self . log_port_number ,
273273 ) ?;
274274 let res = client. call ( req) . await ?;
275- if res. status ( ) != http :: StatusCode :: OK {
275+ if ! res. status ( ) . is_success ( ) {
276276 let err = format ! ( "unable to initialize the logs api: {}" , res. status( ) ) ;
277277 return Err ( ExtensionError :: boxed ( err) ) ;
278278 }
@@ -318,7 +318,7 @@ where
318318 self . telemetry_port_number ,
319319 ) ?;
320320 let res = client. call ( req) . await ?;
321- if res. status ( ) != http :: StatusCode :: OK {
321+ if ! res. status ( ) . is_success ( ) {
322322 let err = format ! ( "unable to initialize the telemetry api: {}" , res. status( ) ) ;
323323 return Err ( ExtensionError :: boxed ( err) ) ;
324324 }
@@ -491,7 +491,7 @@ async fn register<'a>(
491491
492492 let req = requests:: register_request ( & name, events) ?;
493493 let res = client. call ( req) . await ?;
494- if res. status ( ) != http :: StatusCode :: OK {
494+ if ! res. status ( ) . is_success ( ) {
495495 let err = format ! ( "unable to register the extension: {}" , res. status( ) ) ;
496496 return Err ( ExtensionError :: boxed ( err) ) ;
497497 }
You can’t perform that action at this time.
0 commit comments