Skip to content

Commit

Permalink
Added data field in error handler in JS stub generator
Browse files Browse the repository at this point in the history
According to [JSON-RPC](https://www.jsonrpc.org/specification#error_object) specification, the data field is optional, but valid
  • Loading branch information
MasterGroosha committed Feb 11, 2020
1 parent 361356d commit 08d4128
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,7 @@ Trevor Vannoy <[email protected]>

Ranganathan Balakrishnan <[email protected]>
+ add JSON NUMERIC data type to accept both real and integer values

Evgeny Petrov <[email protected]>
+ added data field for error handler
+
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Build example for Centos 7 (#267)
- `Json::Value` example code (#281)
- IPv6 Support for `HttpServer` (#275)
- Added data field in error handler in JS stub generator

### Fixed
- Incorrect README sections (#280)
Expand Down
2 changes: 1 addition & 1 deletion src/stubgenerator/client/jsclientstubgenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ using namespace std;
callback_success(response.id, response.result);\n\
} else if (response.hasOwnProperty(\"error\")) {\n\
if (callback_error != null)\n\
callback_error(response.error.code,response.error.message);\n\
callback_error(response.error.code,response.error.message,response.error.data);\n\
} else {\n\
if (callback_error != null)\n\
callback_error(-32001, \"Invalid Server response: \" + response);\n\
Expand Down

0 comments on commit 08d4128

Please sign in to comment.