File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -151,14 +151,9 @@ impl DdApi {
151151 /// Ship a serialized series to the API, blocking
152152 pub async fn ship_series ( & self , series : & Series ) -> Result < Response , ShippingError > {
153153 let url = format ! ( "{}/api/v2/series" , & self . metrics_intake_url_prefix) ;
154- if let Ok ( safe_body) = serde_json:: to_vec ( & series) {
155- debug ! ( "Sending body: {:?}" , & series) ;
156- self . ship_data ( url, safe_body, "application/json" ) . await
157- } else {
158- Err ( ShippingError :: Payload (
159- "Failed to serialize series" . to_string ( ) ,
160- ) )
161- }
154+ let safe_body = serde_json:: to_vec ( & series) . map_err ( |_| ShippingError :: Payload ( "Failed to serialize series" . to_string ( ) ) ) ?;
155+ debug ! ( "Sending body: {:?}" , & series) ;
156+ self . ship_data ( url, safe_body, "application/json" ) . await
162157 }
163158
164159 pub async fn ship_distributions (
You can’t perform that action at this time.
0 commit comments