Skip to content

Instantly share code, notes, and snippets.

@Calvin-Huang
Created September 16, 2022 04:41
Show Gist options
  • Save Calvin-Huang/dbf0f258b896410ab66ee7ea024845fe to your computer and use it in GitHub Desktop.
Save Calvin-Huang/dbf0f258b896410ab66ee7ea024845fe to your computer and use it in GitHub Desktop.
simple example to show how to not throw the error when expected status code
const {
status,
} = await axios.get(`/foo/${id}`, {
validateStatus: status => status === 200 || status === 404,
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment