Skip to content

Commit 62e104d

Browse files
authoredNov 3, 2022
callback javascript errors instead of objects (#303)
1 parent d45b2ee commit 62e104d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed
 

‎lib/nano.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,9 @@ module.exports = exports = function dbScope (cfg) {
137137
reject(new Error(`error happened in your connection. Reason: ${response.message}`))
138138
}
139139
if (callback) {
140-
const returnError = {
141-
message: `error happened in your connection. Reason: ${response.message}`,
142-
scope: 'socket',
143-
errid: 'request'
144-
}
140+
const returnError = new Error(`error happened in your connection. Reason: ${response.message}`)
141+
returnError.scope = 'socket'
142+
returnError.errid = 'request'
145143
callback(returnError)
146144
}
147145
return

0 commit comments

Comments
 (0)
Please sign in to comment.