Phase 5 - Relay Management UI complete

This commit is contained in:
gitea
2025-11-05 20:58:27 +01:00
parent c2447f4a0d
commit 53d11d49ff
8 changed files with 1685 additions and 469 deletions
+8 -1
View File
@@ -82,7 +82,14 @@ class NostrService {
return _messageControllers[relayUrl]!.stream;
}
final channel = WebSocketChannel.connect(Uri.parse(relayUrl));
// WebSocketChannel.connect can throw synchronously (e.g., host lookup failure)
// Wrap in try-catch to ensure it's caught
WebSocketChannel channel;
try {
channel = WebSocketChannel.connect(Uri.parse(relayUrl));
} catch (e) {
throw NostrException('Failed to connect to relay: $e');
}
_connections[relayUrl] = channel;
final controller = StreamController<Map<String, dynamic>>();