MCPcopy Create free account
hub / github.com/ShareDropio/sharedrop / _onPeerDCIncomingConnectionError

Function _onPeerDCIncomingConnectionError

app/controllers/index.js:101–121  ·  view source on GitHub ↗
(event, data)

Source from the content-addressed store, hash-verified

99 },
100
101 _onPeerDCIncomingConnectionError(event, data) {
102 const { connection, error } = data;
103 const peers = this.model;
104 const peer = peers.findBy('peer.id', connection.peer);
105
106 switch (error.type) {
107 case 'failed':
108 peer.setProperties({
109 'peer.connection': null,
110 'peer.state': 'disconnected',
111 state: 'error',
112 errorCode: 'connection-failed',
113 });
114 break;
115 case 'disconnected':
116 // TODO: notify both sides
117 break;
118 default:
119 break;
120 }
121 },
122
123 _onPeerP2POutgoingConnection(event, data) {
124 const { connection } = data;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected