We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f6d6735 commit acc8cb1Copy full SHA for acc8cb1
1 file changed
packages/node_modules/pouchdb-errors/src/index.js
@@ -60,6 +60,14 @@ function createError(error, reason) {
60
pouchError[name] = error[name];
61
}
62
63
+ try {
64
+ if (pouchError.stack === undefined) {
65
+ pouchError.stack = (new Error()).stack;
66
+ }
67
+ } catch (e) {
68
+ pouchError.stack = 'No stack trace available';
69
70
+
71
if (reason !== undefined) {
72
pouchError.reason = reason;
73
@@ -92,10 +100,6 @@ function generateErrorFromResponse(err) {
92
100
err.message = err.message || err.reason;
93
101
94
102
95
- if (!('stack' in err)) {
96
- err.stack = (new Error()).stack;
97
- }
98
-
99
103
return err;
104
105
0 commit comments