Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

response on catch? #54

Open
fenixphp opened this issue Aug 29, 2018 · 0 comments
Open

response on catch? #54

fenixphp opened this issue Aug 29, 2018 · 0 comments

Comments

@fenixphp
Copy link

fenixphp commented Aug 29, 2018

How to get a response from the server in "catch"?

    model
    .withParams(credentials)
    .post()
    .then((success) => {
      /* Set data. */
     commit('setUser', success.data.data.user);
    })
    .catch((error) => {
      if (error.data.data.message) {
        commit('setErrors', [error.data.data.message]);
      }
    });

Instead, the error object:

Error: Request failed with status code 422
    at createError (D:\Projects\Desionlab\Alex south\fastPanel\terminal\Source\node_modules\axios\lib\core\createError.js:16)
    at settle (D:\Projects\Desionlab\Alex south\fastPanel\terminal\Source\node_modules\axios\lib\core\settle.js:18)
    at XMLHttpRequest.handleLoad (D:\Projects\Desionlab\Alex south\fastPanel\terminal\Source\node_modules\axios\lib\adapters\xhr.js:77)

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant