Phase 5 - Relay Management UI complete
This commit is contained in:
@@ -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>>();
|
||||
|
||||
Reference in New Issue
Block a user