diff --git a/index.js b/index.js index b44892d..42ec93c 100644 --- a/index.js +++ b/index.js @@ -36,10 +36,9 @@ module.exports = function (metadata) { // if buffer fails to decode or there is no info key, then metadata is corrupt info = bncode.encode(bncode.decode(metadata).info) } catch (err) { - // TODO: throw or disregard invalid metadata? - //throw new Error('ut_metadata constructed with invalid metadata') + throw new Error('`ut_metadata` constructed with corrupt/invalid metadata') } - + if (info) this._gotMetadata(info) }