pouchdb-errors
Advanced tools
Comparing version 7.3.1 to 8.0.0
@@ -1,22 +0,20 @@ | ||
import inherits from 'inherits'; | ||
class PouchError extends Error { | ||
constructor(status, error, reason) { | ||
super(); | ||
this.status = status; | ||
this.name = error; | ||
this.message = reason; | ||
this.error = true; | ||
} | ||
inherits(PouchError, Error); | ||
function PouchError(status, error, reason) { | ||
Error.call(this, reason); | ||
this.status = status; | ||
this.name = error; | ||
this.message = reason; | ||
this.error = true; | ||
toString() { | ||
return JSON.stringify({ | ||
status: this.status, | ||
name: this.name, | ||
message: this.message, | ||
reason: this.reason | ||
}); | ||
} | ||
} | ||
PouchError.prototype.toString = function () { | ||
return JSON.stringify({ | ||
status: this.status, | ||
name: this.name, | ||
message: this.message, | ||
reason: this.reason | ||
}); | ||
}; | ||
var UNAUTHORIZED = new PouchError(401, 'unauthorized', "Name or password is incorrect."); | ||
@@ -23,0 +21,0 @@ var MISSING_BULK_DOCS = new PouchError(400, 'bad_request', "Missing JSON list of 'docs'"); |
@@ -5,25 +5,21 @@ 'use strict'; | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
class PouchError extends Error { | ||
constructor(status, error, reason) { | ||
super(); | ||
this.status = status; | ||
this.name = error; | ||
this.message = reason; | ||
this.error = true; | ||
} | ||
var inherits = _interopDefault(require('inherits')); | ||
inherits(PouchError, Error); | ||
function PouchError(status, error, reason) { | ||
Error.call(this, reason); | ||
this.status = status; | ||
this.name = error; | ||
this.message = reason; | ||
this.error = true; | ||
toString() { | ||
return JSON.stringify({ | ||
status: this.status, | ||
name: this.name, | ||
message: this.message, | ||
reason: this.reason | ||
}); | ||
} | ||
} | ||
PouchError.prototype.toString = function () { | ||
return JSON.stringify({ | ||
status: this.status, | ||
name: this.name, | ||
message: this.message, | ||
reason: this.reason | ||
}); | ||
}; | ||
var UNAUTHORIZED = new PouchError(401, 'unauthorized', "Name or password is incorrect."); | ||
@@ -30,0 +26,0 @@ var MISSING_BULK_DOCS = new PouchError(400, 'bad_request', "Missing JSON list of 'docs'"); |
{ | ||
"name": "pouchdb-errors", | ||
"version": "7.3.1", | ||
"version": "8.0.0", | ||
"description": "Errors exposed by PouchDB.", | ||
@@ -15,5 +15,3 @@ "main": "./lib/index.js", | ||
"jsnext:main": "./lib/index.es.js", | ||
"dependencies": { | ||
"inherits": "2.0.4" | ||
}, | ||
"dependencies": {}, | ||
"module": "./lib/index.es.js", | ||
@@ -20,0 +18,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
0
21416
204
- Removedinherits@2.0.4
- Removedinherits@2.0.4(transitive)