Merge pull request #336 from koush/patch-1

Error.message is read only on the QuickJS Runtime.
This commit is contained in:
Diego Rodríguez Baquero 2020-03-29 12:24:38 -05:00 committed by GitHub
commit fc4a0f76a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,7 +130,10 @@ class UDPTracker extends Tracker {
cleanup() cleanup()
if (self.destroyed) return if (self.destroyed) return
if (err.message) err.message += ` (${self.announceUrl})` try {
// Error.message is readonly on some platforms.
if (err.message) err.message += ` (${self.announceUrl})`
} catch (ignoredErr) {}
// errors will often happen if a tracker is offline, so don't treat it as fatal // errors will often happen if a tracker is offline, so don't treat it as fatal
self.client.emit('warning', err) self.client.emit('warning', err)
} }