Q:

How to handle Parse.com Rest API error with AFNetworking 2.0

I am working on handling error received from Parse.com while performing log in in my IOS app. I try logging in with wrong password and correct username using AFNetworking
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
NSDictionary *parameters = @{my parameters};
[manager POST:@"{login url}" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
    code
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    NSLog(@"Error: %@", error.localizedDescription);  <-- this line gets processed
}];

The log says
Request failed: not found (404)

I know that means wrong password, but shouldn't it be more descriptive? How do I handle other error (like Bad Request)? Shouldn't the user knows why the request failed or is a bad one?
EDIT:
This is the response from Parse when I tried to login with the wrong password
{
AFNetworkingOperationFailingURLResponseErrorKey = "<NSHTTPURLResponse: 0x15571820> { URL: https://api.parse.com/1/login?password=pqpqpq&username=lalala%20namaku%20panjang%20sekali%20lhoooooooooooo } { status code: 404, headers {\n    \"Access-Control-Allow-Origin\" = \"*\";\n    \"Access-Control-Request-Method\" = \"*\";\n    Connection = \"keep-alive\";\n    \"Content-Encoding\" = gzip;\n    \"Content-Length\" = 68;\n    \"Content-Type\" = \"application/json; charset=utf-8\";\n    Date = \"Wed, 16 Jul 2014 05:49:49 GMT\";\n    Server = \"nginx/1.4.4\";\n    \"X-Parse-Platform\" = G1;\n    \"X-Runtime\" = \"0.113695\";\n} }";
NSErrorFailingURLKey = "https://api.parse.com/1/login?password=pqpqpq&username=lalala%20namaku%20panjang%20sekali%20lhoooooooooooo";
NSLocalizedDescription = "Request failed: not found (404)";
}

How do I know that this means the User object that match the username and password is not found, OR the URL (https://api.parse.com/1/login?password=pqpqpq&username=lalala%20namaku%20panjang%20sekali%20lhoooooooooooo) that is not found?

A:

Even though it returns with http code 404, the body is set in json form, like 
{"code":101,"error":"invalid login parameters"} , 
( values are listed for example here http://parse.com/docs/dotnet/api/html/T_Parse_ParseException_ErrorCode.htm ) . Since the code does not list exact url and how you set the headers it is hard to tell what is wrong 
here otherwise. 
You can go to https://parse.com/docs/rest#users-login  and see the code example for CURL which will tell you how to call login url and it usually responds with JSON error description.
Also you can check how to get body from HTTP 404 from AFNetworking 2.0 AFHTTPSessionManager: how to get status code and response JSON in failure block?

