Sorry, I pressed Post to early... posting again:
Hi Jeff,
I know that your post is from April, but I just encountered
some issues with the error handling part in batchfb. It is probably not
relevant now, but I am OK with keeping the current exception mechanism
in place.
I do think that some information is missing from the
exception. The exceptions includes the code, subcode and message. But in
the error reply from facebook there are few other fields. The
error_user_title and error_user_msg info can help a lot to quickly
understand what is the exception cause.
In addition, I found a bug in the error handling code:
- in ErrorDetectingWrapper.java under impl, in function checkForStandardGraphError, line 108, I saw the following:
================================================================
// Documented here:
https://developers.facebook.com/docs/graph-api/using-graph-apiif (code == 10 || (code >= 200 || code <= 299))
throw new PermissionException(msg, type, code, subcode);
================================================================
As written in the facebook documentation errors 200-299 are permission issues. But the code should be:
================================================================
// Documented here:
https://developers.facebook.com/docs/graph-api/using-graph-apiif (code == 10 || (code >= 200 && code <= 299))
throw new PermissionException(msg, type, code, subcode);
================================================================
In the original code, if code = 100, we will still throw a PermissionException. the code == 10 will be false, but the (code >= 200 || code <= 299) will be true as code <= 299 is true.
Thanks
Omer