Fetch Error Handling
Preview
Code
<script>
fetch("https://invalid-url")
.then(res=>res.json())
.catch(err=>{
console.log("Error:",err.message);
});
</script>
<script>
fetch("https://invalid-url")
.then(res=>res.json())
.catch(err=>{
console.log("Error:",err.message);
});
</script>