Skip to content
This repository was archived by the owner on Jan 2, 2022. It is now read-only.
This repository was 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

Description

@julianah

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions