js: cleanup error throwing to always use new Error (#504)

This commit is contained in:
Brandon Liu
2024-12-13 14:42:13 +08:00
committed by GitHub
parent 7ed6377031
commit 5b075048cc
4 changed files with 14 additions and 14 deletions

View File

@@ -42,7 +42,7 @@ class MockServer {
this.numRequests++;
const range = request.headers.get("range")?.substr(6).split("-");
if (!range) {
throw Error("invalid range");
throw new Error("invalid range");
}
const offset = +range[0];
const length = +range[1];