🎨 Improve error message

This commit is contained in:
C-3PO 2018-07-08 21:48:17 +02:00
parent 747c6a4c15
commit 0122104f4c
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 at position ${pos}.`);
throw new Error(`Unexpected leading char 0x${header.toString(16)} during Bencode parsing at position ${pos - 1}.`);
}
return { obj, pos };
}