Created
September 16, 2022 04:41
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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