P01yH3dr0n commited on
Commit
408353c
1 Parent(s): 79d182c

Update tagcomplete/javascript/_utils.js

Browse files
Files changed (1) hide show
  1. tagcomplete/javascript/_utils.js +8 -1
tagcomplete/javascript/_utils.js CHANGED
@@ -41,7 +41,14 @@ async function readFile(filePath, json = false, cache = false) {
41
  if (!cache)
42
  filePath += `?${new Date().getTime()}`;
43
 
44
- let response = await fetch(`file=${filePath}`);
 
 
 
 
 
 
 
45
 
46
  if (response.status != 200) {
47
  console.error(`Error loading file "${filePath}": ` + response.status, response.statusText);
 
41
  if (!cache)
42
  filePath += `?${new Date().getTime()}`;
43
 
44
+ while (true) {
45
+ try {
46
+ var response = await fetch(`file=${filePath}`);
47
+ break;
48
+ } catch (e) {
49
+ console.log('Error loading file, try again')
50
+ }
51
+ }
52
 
53
  if (response.status != 200) {
54
  console.error(`Error loading file "${filePath}": ` + response.status, response.statusText);