I am trying to test if the IP address provided by a user is the expected IP, so i send a request to that IP address which is expected to be running the API service, if the IP is correct it return success but if the IP is wrong it returns no response data, in the front-end of the application which is Vue.js i want to be able to know what happened and fire an alert to the user, if its successful i'm able to do that but if its not nothing happens, how do i get that error message?
this is my code
PublisherUrl().get('/api/publish-lv/').then(()=>{
Toast.fire({
icon: 'success',
title: 'Publisher Connected Successfully'
})
}).catch((error)=>{
console.log(error)
Toast.fire({
icon: 'error',
title: 'Publisher Device Unreachable'
})
})
}