[
https://issues.apache.org/jira/browse/THRIFT-3916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15458256#comment-15458256
]
ASF GitHub Bot commented on THRIFT-3916:
----------------------------------------
GitHub user SimenB opened a pull request:
https://github.com/apache/thrift/pull/1075
THRIFT-3916 Throw proper errors from JS, not strings
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/SimenB/thrift THRIFT-3916
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/1075.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1075
----
commit 6800aed951cac7f9e519f601c0e5a99464f65b49
Author: Simen Bekkhus <[email protected]>
Date: 2016-09-02T11:19:56Z
THRIFT-3916 Throw proper errors from JS, not strings
----
> Errors thrown from JavaScript client is strings and not errors
> --------------------------------------------------------------
>
> Key: THRIFT-3916
> URL: https://issues.apache.org/jira/browse/THRIFT-3916
> Project: Thrift
> Issue Type: Bug
> Reporter: Simen Bekkhus
> Labels: javascript
>
> In JavaScript, you can {{throw}} any object, including strings, but to get
> stack traces one should throw {{Errors}}.
> The generated JS code throws the error string directly, instead of wrapping
> it in {{new Error}}.
> Node core _only_ rejects with/throws Errors, never strings, and Thrift should
> follow the same standard.
> https://nodejs.org/api/errors.html#errors_class_error
> {quote}
> All errors generated by Node.js, including all System and JavaScript errors,
> will either be instances of, or inherit from, the Error class.
> {quote}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)