What happens is that in my terminal I have a Python that updates the JSON file in real time, causing the file to be open sometimes updating data, prohibiting the JavaScript from accessing, causing the error.
So in this case I'd like that when JavaScript can't access the file, instead of delivering the error, it simply doesn't do anything, to keep showing the value collected before the error.
But as we can see in the code, I'm using try{}catch(e){}
and even so the error keeps appearing
function refresh_images() {
try {
let selectedstages = document.getElementById("matches").selectedOptions[0].getAttribute("data-stages");
let selectedevents = document.getElementById("matches").selectedOptions[0].getAttribute("data-events");
fetch("testedropdown.json")
.then(response => response.json())
.then(data => {
console.log(data.Stages[selectedstages].Events[selectedevents].Eps)
})
} catch (e) {
}
}