JLuboff / connect-mssql-v2

MS SQL Server session store for Express Session
MIT License
5 stars 7 forks source link

Fix #11 - UnhandledPromiseRejection #13

Closed JLuboff closed 4 years ago

JLuboff commented 4 years ago

@bradtaniguchi Can you review this PR? I have created the sessionError event listener/emitter. This is called from within the errorHandler method which is called from the catch blocks. It sends the error and the method from which the error occurred. Additionally, I check in the errorHandler whether the callback exists, and only call it if so.
I created a test that only tests the errorHandler method (all tests pass). If you're able to come up with a way to test from within the actual methods (I'm not positive on how to throw an error within the method for the purpose of testing only), that would be great.