Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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)
     }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #axios #catch #error #status #cocxe
ADD COMMENT
Topic
Name
7+5 =