I have a backbone collection which is setup to fetch results (events in my case) from a URL and then perform a little bit of data manipulation on the response in a parse method. When there are results provided by the api (as follows), the fetch is successful and everything behaves as expected.
{
events: [
{ event1... },
{ event2... },
...
]
}
However, when the resultset is empty (as follows), the fetch runs its error function instead of the success call, and never seems to execute my parse method at all.
{
events: []
}
Is this behaving as expected? As in, should backbone be throwing the error when there are 0 results, and if so, is there any way of fixing this?
200
? What is the errorText and error of theerror
callback arguments? – jevakallio