Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

REST and Failed Reqests

$
0
0
A model's CRUD actions return instances of the model (resource) you are manipulating. I believe this is the nature of REST-based requests. 

If you create a new instance of a model, by issuing a .save() the request is resolved with your model, with the server's response appended to it. Seems to be the same for destroy. 

What is the correct way to handle the case where you tell the server to create a new instance and it fails on the server for one of many reasons? What should be sent back to the client to indicate this? And what should be done with the response and the model instance that exists in the client?

What are the Bitovi recommended best practices surrounding this?

This is somewhat related to another one of my recent posts.


Viewing all articles
Browse latest Browse all 3491

Trending Articles