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:
parent
692befd8c3
commit
245ba730eb
4 changed files with 20 additions and 16 deletions
17
frontend/js/api/threads.js
Normal file
17
frontend/js/api/threads.js
Normal 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 {};
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue