Skip to content

Commit

Permalink
Parse.Error inherits Error now
Browse files Browse the repository at this point in the history
  • Loading branch information
flovilmart committed Sep 8, 2018
1 parent c5d9863 commit bc24f5a
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 102 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Parse-SDK-JS

## 2.1.0

- Parse.Error now inherits from Error

## 2.0.2

- Fixes issue affecting unsubscribing from liveQueries (#640)
Expand Down
196 changes: 97 additions & 99 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parse",
"version": "2.0.2",
"version": "2.1.0",
"description": "The Parse JavaScript SDK",
"homepage": "https://www.parse.com",
"keywords": [
Expand Down
8 changes: 6 additions & 2 deletions src/ParseError.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@
* Constructs a new Parse.Error object with the given code and message.
* @alias Parse.Error
*/
class ParseError {
class ParseError extends Error {
/**
* @param {Number} code An error code constant from <code>Parse.Error</code>.
* @param {String} message A detailed description of the error.
*/
constructor(code, message) {
super(message);
this.code = code;
this.message = message;
Object.defineProperty(this, 'message', {
enumerable: true,
value: message
});
}

toString() {
Expand Down
Loading

0 comments on commit bc24f5a

Please sign in to comment.