Capturing Laravel’s Error On Axios

Axios is a promised based http client.  Capturing laravel's 422 status error is a bit tricky because the returned data is a dynamic json key.  Here is a simple approach on how we can capture the error status code and throw an error using sweet alert 2. https://gist.github.com/allaniftrue/ca69f9e64f257f88a2983fb55f14025d

Advertisements