Skip to content

Commit bc24f5a

Browse files
committed
Parse.Error inherits Error now
1 parent c5d9863 commit bc24f5a

File tree

5 files changed

+116
-102
lines changed

5 files changed

+116
-102
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Parse-SDK-JS
22

3+
## 2.1.0
4+
5+
- Parse.Error now inherits from Error
6+
37
## 2.0.2
48

59
- Fixes issue affecting unsubscribing from liveQueries (#640)

package-lock.json

Lines changed: 97 additions & 99 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse",
3-
"version": "2.0.2",
3+
"version": "2.1.0",
44
"description": "The Parse JavaScript SDK",
55
"homepage": "https://www.parse.com",
66
"keywords": [

src/ParseError.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@
1111
* Constructs a new Parse.Error object with the given code and message.
1212
* @alias Parse.Error
1313
*/
14-
class ParseError {
14+
class ParseError extends Error {
1515
/**
1616
* @param {Number} code An error code constant from <code>Parse.Error</code>.
1717
* @param {String} message A detailed description of the error.
1818
*/
1919
constructor(code, message) {
20+
super(message);
2021
this.code = code;
21-
this.message = message;
22+
Object.defineProperty(this, 'message', {
23+
enumerable: true,
24+
value: message
25+
});
2226
}
2327

2428
toString() {

0 commit comments

Comments
 (0)