throw exception when metadata is bad

This commit is contained in:
Feross Aboukhadijeh 2014-05-11 14:23:19 -07:00
parent 1968e8ac10
commit 82a02fd81a
1 changed files with 2 additions and 3 deletions

View File

@ -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)