...
11 // 404 Not Found
12function errorHandler(req) {
13    if (req.status == 404) {
14        console.error("Not Found");
15        window.location.href = "/home";
16    }
17}
18
...