Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/core/database/mongodb_connection.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:mongo_dart/mongo_dart.dart';
import 'package:querya_desktop/features/connections/ssl_certificate_support.dart';

Expand Down Expand Up @@ -166,8 +167,8 @@ class MongoConnection {
_db = null;
try {
await db?.close();
} catch (_) {
// Connection may already be closed — ignore.
} catch (e) {
debugPrint('MongoConnection.disconnect: $e');
}
}

Expand Down
3 changes: 2 additions & 1 deletion lib/core/database/mysql_connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ class MysqlConnection {
return true;
}
return false;
} catch (_) {
} catch (e) {
debugPrint('MysqlConnection.testConnection: $e');
return false;
} finally {
await disconnect();
Expand Down
3 changes: 2 additions & 1 deletion lib/core/database/postgres_connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ class PostgresConnection {
);
if (r.isEmpty) return null;
return r.first[0] as bool;
} catch (_) {
} catch (e) {
debugPrint('PostgresConnection.inOpenTransaction: $e');
return null;
}
}
Expand Down
10 changes: 6 additions & 4 deletions lib/core/database/redis_connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class RedisConnection {
_conn = null;
try {
await c?.close();
} catch (_) {
// Connection may already be closed — ignore.
} catch (e) {
debugPrint('RedisConnection.disconnect: $e');
}
}

Expand All @@ -129,7 +129,8 @@ class RedisConnection {
try {
await connect();
return true;
} catch (_) {
} catch (e) {
debugPrint('RedisConnection.testConnection: $e');
return false;
} finally {
await disconnect();
Expand Down Expand Up @@ -164,7 +165,8 @@ class RedisConnection {
if (result is List && result.length >= 2) {
return int.tryParse(result[1].toString()) ?? 16;
}
} catch (_) {
} catch (e) {
debugPrint('RedisConnection.getMaxDatabases: $e');
// Some Redis instances don't allow CONFIG; fall back.
}
return 16;
Expand Down
3 changes: 2 additions & 1 deletion lib/core/database/sqlite_connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ class SqliteConnection {
return true;
}
return false;
} catch (_) {
} catch (e) {
debugPrint('SqliteConnection.testConnection: $e');
return false;
} finally {
await disconnect();
Expand Down
Loading