throw exception when metadata is bad
This commit is contained in:
parent
1968e8ac10
commit
82a02fd81a
3
index.js
3
index.js
|
@ -36,8 +36,7 @@ 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)
|
||||
|
|
Loading…
Reference in New Issue