Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

how to get the status code error message in axios code example

Example: axios try catch get error status cocxe

try {
     	await axios.get('/bad-call')
     } catch (error) {
        const err = error as AxiosError
        if (err.response) {
           console.log(err.response.status)
           console.log(err.response.data)
        }
        this.handleAxiosError(error)
     }

Tags:

Javascript Example

Related

get current post informations wordpress code example how to find a child gameobject in unity code example string to guid conversion c# code example connect ot mongodb database code example cat command on windows code example jest test (error,data) in callback code example catch error code javascript code example group panda dataframe code example how to create a thread local variable in java code example can switch case be used for strings php code example how to refresh div after ajax success code example how to find nic name in linux code example

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy