🎨 Improve error message

This commit is contained in:
C-3PO 2018-07-08 21:47:12 +02:00
parent c76d5035bd
commit 747c6a4c15
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

@ -73,7 +73,7 @@ function bpParse(dv: DataView, posIn: number = 0): { obj: any, pos: number } {
break;
}
default:
throw new Error('Unexpected leading char during bencode parsing.');
throw new Error(`Unexpected leading char during bencode parsing at position ${pos}.`);
}
return { obj, pos };
}