try catch
This commit is contained in:
parent
d11f83b05a
commit
3b2e376ffa
1 changed files with 27 additions and 23 deletions
|
|
@ -78,6 +78,7 @@ export default class webRTC {
|
|||
console.log('ondatachannel', event)
|
||||
const channel = event.channel
|
||||
channel.addEventListener('message', async (event) => {
|
||||
try {
|
||||
const j = JSON.parse(event.data) as Types.SingleUsageMetricReq
|
||||
const err = Types.SingleUsageMetricReqValidate(j, {
|
||||
app_id_CustomCheck: id => id === u.appId,
|
||||
|
|
@ -102,6 +103,9 @@ export default class webRTC {
|
|||
const bytes = encodeTLV(tlv)
|
||||
channel.send(bytes)
|
||||
}
|
||||
} catch (e: any) {
|
||||
this.log(ERROR, 'ondatachannel', e.message || e)
|
||||
}
|
||||
})
|
||||
}
|
||||
/* conn.oniceconnectionstatechange = (event) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue