MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

ResponseItem.getError*() methods not implemented?

Last post 03-24-2008 11:59 PM by Chad Russell. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-14-2008 12:06 PM

    • Egg
    • Top 50 Contributor
    • Joined on 02-05-2008
    • Posts 73

    ResponseItem.getError*() methods not implemented?

    I read over http://developer.myspace.com/community/myspace/opensocialref.aspx#opensocial.ResponseItem.getErrorMessage and it looks like I should be able to get the error message for why a request fails from the ResponseItem. For example, I make a call and when I get the result back, I've got an error... but what is the error?

    var dataRequest = opensocial.newDataRequest();
    var userById = dataRequest.newFetchPersonRequest(id);
    dataRequest.add(userById,"userById");
    dataRequest.send(results);

    function results(dataResponse){
    if(!dataResponse.hadError()){
    // do stuff with this user
    } else {
    document.write(dataResponse.getErrorMessage());
    document.write(dataResponse.getErrorCode());
    }
    }
  • 03-19-2008 8:17 AM In reply to

    • Egg
    • Top 50 Contributor
    • Joined on 02-05-2008
    • Posts 73

    Re: ResponseItem.getError*() methods not implemented?

    In case anyone else stumbles into this thread, the error is that dataRequest.newFetchPersonRequest(id); with an id value isn't actually supported despite being part of the OpenSocial 0.7 spec.

    The methods just aren't implemented... I've not been able to get word if they're going to be any time soon.

  • 03-24-2008 11:59 PM In reply to

    Re: ResponseItem.getError*() methods not implemented?

    You're attempting to get an error from the DataResponse object.  A DataResponse object contains a collection of requests/responses, calling getError there doesn't make sense as there could be several errors -- which error would the response return?

    http://code.google.com/apis/opensocial/docs/0.7/reference/opensocial.DataRequest.html

    What you want to do is look for the error on the individual ResponseItem object, so dataResponse.get(whatever).getErrorMessage())

    http://code.google.com/apis/opensocial/docs/0.7/reference/opensocial.ResponseItem.html

Page 1 of 1 (3 items)