How to parse the error in the json response

Hi everyone, sorry if this isnt the place for this question in advance!

When checking who follows who I stumbled upon a problem ( checking via ) :
If Person A is following Person B the json response will show you some kind of data, BUT
If Person A does not follow Person B in my console I see the following error :
GET… 404
In the error response {“error”:“Not Found”,“status”:404,“message”:“Person A is not following Person B”}
Thats alright and all, but how can I parse that even if its a 404 error ?

For example I want to parse the “message” in #myDiv

json parse the body response. Or just assume that a 404 means person a is not following person b.

Can’t advise much else without seeing your code.

This is more a general issue with your code and not the API. So the language you are using would/can/should be able to handle a 404

Hi Barry
I am checking multiple people at once so something like
is person A following person Z
is person B following person Z
The code only gives me response when The first person is following the second, but not when he is not

The code here

         dataType: "jsonp",
         url: "",
          success: function viewera(data){

//seeing the result in the console
//gets the viewers
  $.each(, function(i, field) {
      var viewers = field;
      // Check if they are followers!
            var follow = "" + viewers + "/follows/channels/" + userName + "?client_id=xxx";
             $.getJSON(follow, function(resulta){
                 $.each(resulta, function(i2, field2) {
                $("#go").append("<p>" + field2 + "</p>");

I did not find anything related to my problem on stackoverflow so I was hoping I can find some help here !
Thank you in advance!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.