ryan-alfi / opensocial-java-client

Automatically exported from code.google.com/p/opensocial-java-client
Apache License 2.0
0 stars 0 forks source link

Invalid RPC enpoint results with unfriendly error.... #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Invoke the client with an RPC endpoint set to "".

I inadvertently set the RPC enpoint to "" in one of my test invocations
using the java client.  The return value is:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1

The problem comes at line 59 in OpenSocialBatch.java.
    if (rpcEndpoint != null) {
      return this.submitRpc(client);
    } else {
      return this.submitRest(client);
    }
  }

Here, the endpoint is not null, but it's clearly not a valid endpoint
either.  Maybe there is a way to validate the OpenSocialUrl so that prior
to making the request, you know if you at least have a good URL.

Original issue reported on code.google.com by weitzelm...@gmail.com on 4 Dec 2008 at 6:56