File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
use serde:: Deserialize ;
2
2
3
3
/// Request tracing information
4
- #[ derive( Debug , Deserialize ) ]
4
+ #[ derive( Debug , Default , Deserialize ) ]
5
5
#[ serde( rename_all = "camelCase" ) ]
6
6
pub struct Tracing {
7
7
/// The type of tracing exposed to the extension
@@ -20,6 +20,7 @@ pub struct InvokeEvent {
20
20
/// The function's Amazon Resource Name
21
21
pub invoked_function_arn : String ,
22
22
/// The request tracing information
23
+ #[ serde( default ) ]
23
24
pub tracing : Tracing ,
24
25
}
25
26
Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ where
272
272
self . log_port_number ,
273
273
) ?;
274
274
let res = client. call ( req) . await ?;
275
- if res. status ( ) != http :: StatusCode :: OK {
275
+ if ! res. status ( ) . is_success ( ) {
276
276
let err = format ! ( "unable to initialize the logs api: {}" , res. status( ) ) ;
277
277
return Err ( ExtensionError :: boxed ( err) ) ;
278
278
}
@@ -318,7 +318,7 @@ where
318
318
self . telemetry_port_number ,
319
319
) ?;
320
320
let res = client. call ( req) . await ?;
321
- if res. status ( ) != http :: StatusCode :: OK {
321
+ if ! res. status ( ) . is_success ( ) {
322
322
let err = format ! ( "unable to initialize the telemetry api: {}" , res. status( ) ) ;
323
323
return Err ( ExtensionError :: boxed ( err) ) ;
324
324
}
@@ -491,7 +491,7 @@ async fn register<'a>(
491
491
492
492
let req = requests:: register_request ( & name, events) ?;
493
493
let res = client. call ( req) . await ?;
494
- if res. status ( ) != http :: StatusCode :: OK {
494
+ if ! res. status ( ) . is_success ( ) {
495
495
let err = format ! ( "unable to register the extension: {}" , res. status( ) ) ;
496
496
return Err ( ExtensionError :: boxed ( err) ) ;
497
497
}
You can’t perform that action at this time.
0 commit comments