@peers-app/peers-sdk 0.7.7 → 0.7.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -126,6 +126,9 @@ class Connection {
|
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
catch (e) {
|
|
129
|
+
if (typeof e?.message === 'string' && e.message.includes('bad public key size')) {
|
|
130
|
+
this.close();
|
|
131
|
+
}
|
|
129
132
|
console.error(`Error connection.emit for ${eventName}(${JSON.stringify(args)})`, e);
|
|
130
133
|
return reject(e);
|
|
131
134
|
}
|
|
@@ -153,7 +156,12 @@ class Connection {
|
|
|
153
156
|
console.error(`Error handling ${eventName}(${JSON.stringify(args)})`, e);
|
|
154
157
|
let rpcError = { error: e.message, errorType: 'RPC_ERROR' };
|
|
155
158
|
if (this._verified && !this.secure) {
|
|
156
|
-
|
|
159
|
+
try {
|
|
160
|
+
rpcError = this.localDevice.signAndBoxDataForDevice(rpcError, this._remoteDeviceInfo);
|
|
161
|
+
}
|
|
162
|
+
catch (e) {
|
|
163
|
+
console.error('Error signing and boxing RPC error', e);
|
|
164
|
+
}
|
|
157
165
|
}
|
|
158
166
|
callback(rpcError);
|
|
159
167
|
}
|