File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -245,13 +245,18 @@ fn merge_with_existing_attributes(
245245 attributes : & Map < String , Value > ,
246246 attrs_str : & str ,
247247) -> Option < String > {
248- if let Ok ( mut existing_attrs) = serde_json:: from_str :: < Map < String , Value > > ( attrs_str) {
249- for ( key, value) in attributes {
250- existing_attrs. insert ( key. clone ( ) , value. clone ( ) ) ;
248+ match serde_json:: from_str :: < Map < String , Value > > ( attrs_str) {
249+ Ok ( mut existing_attrs) => {
250+ for ( key, value) in attributes {
251+ existing_attrs. insert ( key. clone ( ) , value. clone ( ) ) ;
252+ }
253+ serde_json:: to_string ( & existing_attrs) . ok ( )
254+ }
255+ Err ( e) => {
256+ tracing:: warn!( "failed to deserialize existing attributes: {e}" ) ;
257+ None
251258 }
252- return serde_json:: to_string ( & existing_attrs) . ok ( ) ;
253259 }
254- None
255260}
256261
257262/// Merge attributes with an existing JSON object of attributes
You can’t perform that action at this time.
0 commit comments