Skip to content

Instantly share code, notes, and snippets.

@rsvalerio
Created October 28, 2012 23:29
Show Gist options
  • Save rsvalerio/3970438 to your computer and use it in GitHub Desktop.
Save rsvalerio/3970438 to your computer and use it in GitHub Desktop.
couchdb docutil angular service
chefiaAdmServices.factory('DocUtil', function(Mensagem){
return {
errorFunction : function (retorno) {
if (retorno.data && retorno.data.error) {
switch (retorno.data.error) {
case "conflict":
Mensagem.error('Recupere antes de modificar.');
break;
case "deleted":
Mensagem.error('Registro apagado');
break;
default:
Mensagem.error( retorno.data.reason );
}
}
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment