mardi 22 mars 2016

How to get more specific errors, Ember Data 422 Error

I am attempting a post action using Ember-Data, and getting the following error which seems pretty common:

 Error: The adapter rejected the commit because it was invalid

Problem is, seems like usually this returns more specific errors; I am only seeing the above message and a generic 422 error from the browser.

Does anyone know what I can do to access any specific error messages that might be thrown?

Potentially relevant info:

Using jsonapify on an express server to write to MongoDB

router.post('/',
    jsonapify.create('info'),
    logger.logErrors(), jsonapify.errorHandler()
);

I would expect the following code to log some sort of response but I am never able to see the message in this console.log:

info.save().then((response)=> {
        console.log(`Server responded with ${response}`);
      });

Sorry for the vagueness here, I'm sure there could be all sorts of problems with my models and whatnot, but I want to know what I can do to find the more specific errors if they exist.

Thanks much and plz lmk if I can update with more info.




Aucun commentaire:

Enregistrer un commentaire