File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ pub enum WebhookError {
3535 #[ error( "invalid webhook signature: {0}" ) ]
3636 InvalidSignature ( String ) ,
3737 /// Failed to deserialize webhook payload
38- #[ error( "failed to deserialize webhook payload: {0 }" ) ]
39- Deserialization ( # [ from ] serde_json:: Error ) ,
38+ #[ error( "failed to deserialize webhook payload: error:{0} content:{1 }" ) ]
39+ Deserialization ( serde_json:: Error , String ) ,
4040}
4141
4242#[ derive( Debug , thiserror:: Error ) ]
Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ impl Webhooks {
4848 ) ?;
4949
5050 // Deserialize the event
51- let event: WebhookEvent = serde_json:: from_str ( body) ?;
51+ let event: WebhookEvent = serde_json:: from_str ( body)
52+ . map_err ( |e| WebhookError :: Deserialization ( e, body. to_string ( ) ) ) ?;
5253
5354 Ok ( event)
5455 }
You can’t perform that action at this time.
0 commit comments