@@ -107,12 +107,16 @@ private static void DiscordJsonErrorHandler(object? sender, ErrorEventArgs e, Ba
107
107
var sentryMessage = "DiscordJson error on deserialization (" + ( sender ? . GetType ( ) . Name ?? "x" ) + ")\n \n " +
108
108
"Path: " + e . ErrorContext . Path + "\n " +
109
109
"Original Object" + e . ErrorContext . OriginalObject + "\n " +
110
- "Current Object" + e . CurrentObject ;
110
+ "Current Object" + e . CurrentObject + "\n \n " +
111
+ "JRE Message:" + jre . Message + "\n " +
112
+ "JRE Line Number: " + jre . LineNumber + "\n " +
113
+ "JRE Line Position" + jre . LinePosition + "\n " +
114
+ "JRE Path" + jre . Path ;
111
115
SentryEvent sentryEvent = new ( new DiscordJsonException ( jre ) )
112
116
{
113
117
Level = SentryLevel . Error ,
114
118
Logger = nameof ( DiscordJson ) ,
115
- Message = sentryMessage
119
+ Message = Utilities . StripIds ( sentryMessage , discord . Configuration . EnableDiscordIdScrubber )
116
120
} ;
117
121
sentryEvent . SetFingerprint ( BaseDiscordClient . GenerateSentryFingerPrint ( sentryEvent ) ) ;
118
122
if ( discord . Configuration . AttachUserInfo && discord . CurrentUser is not null )
@@ -128,6 +132,8 @@ private static void DiscordJsonErrorHandler(object? sender, ErrorEventArgs e, Ba
128
132
} ;
129
133
var sid = discord . Sentry . CaptureEvent ( sentryEvent ) ;
130
134
_ = Task . Run ( discord . Sentry . FlushAsync ) ;
135
+ if ( discord . Configuration . EnableLibraryDeveloperMode )
136
+ discord . Logger . LogInformation ( "DiscordJson exception reported to sentry with id {sid}" , sid . ToString ( ) ) ;
131
137
}
132
138
133
139
/// <summary>
@@ -202,7 +208,7 @@ private static T DeserializeObjectInternal<T>(string? json, BaseDiscordClient? d
202
208
var sid = discord . Sentry . CaptureEvent ( sentryEvent ) ;
203
209
_ = Task . Run ( discord . Sentry . FlushAsync ) ;
204
210
if ( discord . Configuration . EnableLibraryDeveloperMode )
205
- discord . Logger . LogInformation ( "Reported to sentry with id {sid}" , sid . ToString ( ) ) ;
211
+ discord . Logger . LogInformation ( "Missing fields reported to sentry with id {sid}" , sid . ToString ( ) ) ;
206
212
207
213
return obj ;
208
214
}
@@ -280,7 +286,7 @@ private static T DeserializeIEnumerableObjectInternal<T>(string? json, BaseDisco
280
286
var sid = discord . Sentry . CaptureEvent ( sentryEvent ) ;
281
287
_ = Task . Run ( discord . Sentry . FlushAsync ) ;
282
288
if ( discord . Configuration . EnableLibraryDeveloperMode )
283
- discord . Logger . LogInformation ( "Reported to sentry with id {sid}" , sid . ToString ( ) ) ;
289
+ discord . Logger . LogInformation ( "Missing fields reported to sentry with id {sid}" , sid . ToString ( ) ) ;
284
290
285
291
return obj ;
286
292
}
0 commit comments