MCPcopy
hub / github.com/apache/pouchdb / createError

Function createError

lib/index-browser.js:511–532  ·  view source on GitHub ↗
(error, reason)

Source from the content-addressed store, hash-verified

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

Callers 15

tryFilterFunction · 0.70
invalidIdErrorFunction · 0.70
_setupMethod · 0.70
index-browser.jsFile · 0.70
filterFunction · 0.70
parseRevisionInfoFunction · 0.70
parseDocFunction · 0.70
parseBase64Function · 0.70
updateDocFunction · 0.70
insertDocFunction · 0.70
idbErrorFunction · 0.70
verifyAttachmentFunction · 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…