Skip to content
This repository has been archived by the owner on Jan 2, 2022. It is now read-only.

jsonrpc.js On handling errors by the server response.error !== null needed line 262 #19

Open
julianah opened this issue Nov 4, 2013 · 0 comments

Comments

@julianah
Copy link

julianah commented Nov 4, 2013

Hi,
Using a server like:

from jsonrpc import handleCGI, ServiceMethod

class BasicService:
@ServiceMethod
def echo(self,msg):
return msg
@ServiceMethod
def add (self,a,b):
return a + b

if name == 'main':
service = BasicService()
handleCGI(service)

And a js client like

var jsonService = new JsonRpc.ServiceProxy("http://localhost/jsonrpcserver.py", {
asynchronous: true,
methods: ['echo']
});

JsonRpc.setAsynchronous(jsonService, true);

try {
jsonService.echo(
{
params: ['boo'],
onSuccess: function(result) {
console.log("result is " + result);
},
onException: function(e) {
console.log("Unable to compute because: " + e);
return true;
}
});
} catch (Exception) {
log.error("erorr running ecbo");
}

line 262: if (response.error !== undefined && response.error !== null)

response.error !== null needs to be added?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant