File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -474,8 +474,13 @@ internal static async Task<MySqlDataReader> CreateAsync(CommandListPosition comm
474474 await dataReader . NextResultAsync ( ioBehavior , cancellationToken ) . ConfigureAwait ( false ) ;
475475 }
476476 }
477- catch ( Exception )
477+ catch ( Exception ex )
478478 {
479+ if ( activity is { IsAllDataRequested : true } )
480+ {
481+ activity . SetException ( ex ) ;
482+ activity . Stop ( ) ;
483+ }
479484 dataReader . Dispose ( ) ;
480485 throw ;
481486 }
Original file line number Diff line number Diff line change @@ -36,7 +36,13 @@ internal static class ActivitySourceHelper
3636 return activity ;
3737 }
3838
39- public static void SetSuccess ( this Activity activity ) => activity . SetTag ( StatusCodeTagName , "OK" ) ;
39+ public static void SetSuccess ( this Activity activity )
40+ {
41+ if ( activity . Duration == TimeSpan . Zero )
42+ {
43+ activity . SetTag ( StatusCodeTagName , "OK" ) ;
44+ }
45+ }
4046
4147 public static void SetException ( this Activity activity , Exception exception )
4248 {
You can’t perform that action at this time.
0 commit comments