Ajax response successful but is triggering the error function

Ajax response successful but is triggering the error function

Hey guys,

I have this ajax call:

  1. $.ajax({
  2.        url: baseUrl + "/concerts", 
  3.        type: type,  
  4.        contentType: "application/json",
  5.        dataType: "json",
  6.        data: JSON.stringify(jsonConcert),
  7.        async: false,
  8.        crossDomain: true,

  9.        success:function(result) {
  10.           concerts = data;
  11.           },
  12.        error: function(result){
  13.        alert("Error saving concert");
  14.        }
  15.    });
This is the jsonConcert object:

  1. Object {additionalInfo: "Christian Rock", authorId: 0, date: "04/30/2014", gender: "Rock", id: 12…}
  2. additionalInfo: "Christian Rock"
  3. authorId: 0
  4. date: "04/30/2014"
  5. gender: "Rock"
  6. id: 12
  7. likes: 0
  8. location: "São Paulo"
  9. price: "150.00"
  10. singer: "POD"
  11. unlikes: 0
  12. __proto__: Object
But since I'm using JSON.stringfy, this will be the value checked in the server:

  1. {"additionalInfo":"Christian Rock","authorId":0,"date":"04/30/2014","gender":"Rock","id":12,"likes":0,"location":"São Paulo","price":"150.00","singer":"POD","unlikes":0}

The problem I'm facing is I could save the value in the database, the status.response got was a 200 but some how is the error function is triggered instead of the success. Does anyone have a guess of what is happening ?

Another question is: Should I use stringfy or not in this case ?

Thank you all very much,