sajad torkamani
const axios = require('axios')

axios.get('https://some-non-existing-url.com')
    .then(response => {
        console.log(response.data)
    })
    .catch(error => {
        if (axios.isAxiosError(error)) {
            const requestUrl = error.config.url; // Here's the request URL that caused the error
            console.log('Error URL:', requestUrl);
        } else {
            console.error('Some other error occurred:', error.message);
        }
    })
Tagged: Axios

Leave a comment

Your email address will not be published. Required fields are marked *