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

Result de erro apresente TypeError: Cannot read property 'data' of undefined no front end #651

Open
schirrel opened this issue Apr 17, 2018 · 0 comments

Comments

@schirrel
Copy link

Estou tentando disoparar no meu controleler

validation.add(new SimpleMessage("O usuário não existe", "HTTP 404")); validation.onErrorUse(Results.json()).from(validation.getErrors(), "errors").serialize(); result.use(Results.json()).from("O usuário não existe", "data").serialize();

o que eu tenho de retorno no response (do network do chrome)
{"errors":[{"category":"O usuário não existe","message":"HTTP 404"}]}

mas no console aparece

TypeError: Cannot read property 'data' of undefined

Ja tentei adicioanr body, include com o nome de data, mas nada resolve o erro. Isso so ocorre quando eu quero forçar a resposta do back end a ser negativa (bad request, not found, no accetanble) e por ai vai

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