What best practices for Knockout js have you used when ajax json responses come back bad.
How do you create your mappings to display an error has occured to the user? Ho
Personally I would only update the knockout models upon success. This then leaves the models in the same state as prior to the error.
In the case of an error, you could do anything you want to tell the user there has been an error. I would use humane.js to show a message to the user that the update or creation has failed for some reason. In your three cases for model error, no response or server error, you could check the state of the post in the error function and choose a different message to display to the user
They then have the freedom to do the same thing again, or correct their mistake and try again.
$.post("somewhere")
.success(function() {
// update knockout models here
})
.error(function() {
// show error message to user
})
.complete(function() {
// reset any temporary variables
});