Closed JLuboff closed 4 years ago
When re-doing the types I noticed that all the callback
parameters in the store methods could be undefined. I didn't include this in the types settings as I assume everything was working properly.
Since the code is always executing the callback
parameter that might be the problem. (it could be undefined
or null
or something being passed instead)
That's a good point. I was thinking I have catch blocks every where, so errors should be handled but you're right, if callback
is undefined, its going to throw an unhandled rejection. Perhaps I create an additional event listener this.databaseConnection.on('sessionError', error => this.emit('sessionError', error));
and emit that in the catch blocks and only return the callback
with the error if callback
is not undefined.
Reopening issue as I am still getting TypeError: callback is not a function
once hourly.
While idle, experienced an UnhandledPromiseRejectionWarning: TypeError: callback is not a function. Calling function - MSSQLStore.ready (private method)