1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-07 06:06:23 -07:00

Properly catch errors in thread API AJAX requests

This commit is contained in:
Eggbertx 2022-08-17 14:30:57 -07:00
parent 692befd8c3
commit 245ba730eb
4 changed files with 20 additions and 16 deletions

View file

@ -0,0 +1,17 @@
/* global webroot */
import $ from "jquery";
export function getThreadJSON(threadID, board) {
return $.ajax({
url: `${webroot}${board}/res/${threadID}.json`,
cache: false,
dataType: "json",
error: function(e, status, statusText) {
// clearInterval(threadWatcherInterval);
return {};
}
}).catch(e => {
return {};
});
}