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

Function createError

lib/index.es.js:499–520  ·  view source on GitHub ↗
(error, reason)

Source from the content-addressed store, hash-verified

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

Callers 15

tryFilterFunction · 0.70
invalidIdErrorFunction · 0.70
_setupMethod · 0.70
index.es.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…