MCPcopy Index your code
hub / github.com/apache/pouchdb / createError

Function createError

lib/index.js:504–525  ·  view source on GitHub ↗
(error, reason)

Source from the content-addressed store, hash-verified

502var INVALID_URL = new PouchError(413, 'invalid_url', 'Provided URL is invalid');
503
504function createError(error, reason) {
505 function CustomPouchError(reason) {
506 // inherit error properties from our parent error manually
507 // so as to allow proper JSON parsing.
508 var names = Object.getOwnPropertyNames(error);
509 for (var i = 0, len = names.length; i < len; i++) {
510 if (typeof error[names[i]] !== 'function') {
511 this[names[i]] = error[names[i]];
512 }
513 }
514
515 if (this.stack === undefined) {
516 this.stack = (new Error()).stack;
517 }
518
519 if (reason !== undefined) {
520 this.reason = reason;
521 }
522 }
523 CustomPouchError.prototype = PouchError.prototype;
524 return new CustomPouchError(reason);
525}
526
527function generateErrorFromResponse(err) {
528

Callers 15

tryFilterFunction · 0.70
invalidIdErrorFunction · 0.70
_setupMethod · 0.70
index.jsFile · 0.70
filterFunction · 0.70
parseRevisionInfoFunction · 0.70
parseDocFunction · 0.70
updateDocFunction · 0.70
insertDocFunction · 0.70
LevelPouchFunction · 0.70
verifyAttachmentFunction · 0.70
writeDocFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…