Skip to content

Instantly share code, notes, and snippets.

@mpaccione
Created August 11, 2018 00:15
Show Gist options
  • Save mpaccione/adc914dae015049ab25303c8b1d57053 to your computer and use it in GitHub Desktop.
Save mpaccione/adc914dae015049ab25303c8b1d57053 to your computer and use it in GitHub Desktop.
catch doesnt work
fetch("https://www.mystrainconnect.com:8081/getAllUsers",
{
method: "GET",
headers: {
'Content-Type': 'application/json'
}
}).then(res => res.json())
.catch(error => console.error('Error:', error))
.then(response => {
console.log('Success:', response);
this.commit("setAllUsers", response);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment