mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-03-03 12:16:47 +00:00
improve logging
This commit is contained in:
parent
80910c1ba0
commit
cf0132e75b
2 changed files with 13 additions and 1 deletions
|
|
@ -193,7 +193,11 @@ class ApiService {
|
|||
}
|
||||
|
||||
Future<void> _onError(dynamic e) async {
|
||||
Log.warn('websocket error: $e');
|
||||
if (e.toString().contains('Failed host lookup')) {
|
||||
Log.info('WebSocket connection failed: Host not reachable.');
|
||||
} else {
|
||||
Log.warn('websocket error: $e');
|
||||
}
|
||||
await onClosed();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,14 @@ Future<bool> canMediaFileBeDownloaded(MediaFile mediaFile) async {
|
|||
// If not delete the message as it can not be downloaded from the server anymore.
|
||||
|
||||
if (messages.length != 1) {
|
||||
if (messages.isEmpty) {
|
||||
MediaFileService(mediaFile).fullMediaRemoval();
|
||||
await twonlyDB.mediaFilesDao.deleteMediaFile(mediaFile.mediaId);
|
||||
Log.warn(
|
||||
'Media file which is in downloading status has not text message. Deleting media file. ${mediaFile.mediaId}.',
|
||||
);
|
||||
return false;
|
||||
}
|
||||
Log.warn(
|
||||
'A media for download must have one original message, but it has ${messages.length}.',
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue