fix: make representation warning into a breadcrumb, don't log error on tts cancelled or interupted (#1363)
This commit is contained in:
parent
0e312417d0
commit
6f25884915
2 changed files with 25 additions and 17 deletions
|
|
@ -123,16 +123,17 @@ class RepresentationEvent {
|
|||
if (tokens != null) return tokens!;
|
||||
|
||||
if (_event == null && timestamp.isAfter(DateTime(2024, 9, 25))) {
|
||||
ErrorHandler.logError(
|
||||
m: 'representation with no _event and no tokens got tokens directly. This means an original_sent with no tokens. This should not happen in messages sent after September 25',
|
||||
s: StackTrace.current,
|
||||
data: {
|
||||
'content': content.toJson(),
|
||||
'event': _event?.toJson(),
|
||||
'timestamp': timestamp.toIso8601String(),
|
||||
'senderID': senderID,
|
||||
},
|
||||
level: SentryLevel.warning,
|
||||
Sentry.addBreadcrumb(
|
||||
Breadcrumb.fromJson({
|
||||
'message':
|
||||
'representation with no _event and no tokens got tokens directly. This means an original_sent with no tokens. This should not happen in messages sent after September 25',
|
||||
'data': {
|
||||
'content': content.toJson(),
|
||||
'event': _event?.toJson(),
|
||||
'timestamp': timestamp.toIso8601String(),
|
||||
'senderID': senderID,
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
final List<PangeaToken> res =
|
||||
|
|
|
|||
|
|
@ -40,13 +40,20 @@ class TtsController {
|
|||
await _languageSubscription?.cancel();
|
||||
}
|
||||
|
||||
void _onError(dynamic message) => ErrorHandler.logError(
|
||||
e: message,
|
||||
m: (message.toString().isNotEmpty) ? message.toString() : 'TTS error',
|
||||
data: {
|
||||
'message': message,
|
||||
},
|
||||
);
|
||||
void _onError(dynamic message) {
|
||||
// the package treats this as an error, but it's not
|
||||
// don't send to sentry
|
||||
if (message == 'canceled' || message == 'interrupted') {
|
||||
return;
|
||||
}
|
||||
|
||||
ErrorHandler.logError(
|
||||
e: 'TTS error',
|
||||
data: {
|
||||
'message': message,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> setupTTS() async {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue