Skip to content
This repository has been archived by the owner on Dec 17, 2020. It is now read-only.

Commit

Permalink
let error (content) pass to calling callback method and skip alert call
Browse files Browse the repository at this point in the history
  • Loading branch information
projekt01 committed Aug 23, 2009
1 parent 305b324 commit e99a093
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
11 changes: 7 additions & 4 deletions CHANGES.txt
Expand Up @@ -2,15 +2,18 @@
CHANGES
=======

Version 0.5.1dev (unreleased)
-----------------------------
0.6.0 (unreleased)
------------------

- Implemented JSON-RPC 2.0 specification. Use JSON-RPC 2.0 version as default.
Optional the version 1.0 and 1.1 can be set. See JSON-RPC 2.0 specification
for more information.

- skip alert on errors, pass them to the calling javascript method if callback
method is given

Version 0.5.0 (2008-04-16)
-------------------------

0.5.0 (2008-04-16)
------------------

- Initial Release
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -22,7 +22,7 @@ def read(*rnames):

setup (
name='z3c.jsonrpcproxy',
version='0.5.1dev',
version='0.6.0',
author = "Roger Ineichen and the Zope Community",
author_email = "zope3-dev@zope.org",
description = "JSON RPC (javascript) proxy implementation for Zope3",
Expand Down
13 changes: 3 additions & 10 deletions src/z3c/jsonrpcproxy/js/z3c.jsonrpcproxy-0.5.0.js
Expand Up @@ -2,7 +2,7 @@
/**
* @fileoverview JSON-RPC client implementation
* @author Roger Ineichen dev at projekt01 dot ch
* @version 0.6, supports JSON-RPC 1.0, 1.1 and 2.0
* @version 0.5.0 supports JSON-RPC 1.0, 1.1 and 2.0
*/
//----------------------------------------------------------------------------

Expand Down Expand Up @@ -157,15 +157,8 @@ JSONRPCMethod.prototype.handleResponse = function(resp){
alert("The server responded with an empty document.");
}else{
var res = this.unmarshall(respTxt);
var oldVersion = false;
if (this.version == '1.0' || this.version == '1.1') {
oldVersion = true;
}
if(oldVersion && res.error != null){
alert(res.error);
}
else if(!oldVersion && res.error != null){
alert(res.error.message);
if(res.error != null){
return res.error
}
else if (res.requestId != self.requestId) {
alert("wrong json id returned");
Expand Down

0 comments on commit e99a093

Please sign in to comment.