You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to support throwing errors from tracker.response. It's almost working today but the setTimeout() that surrounds the internals of the Promise in Tracker._handle puts the exception in the wrong context and hence it's not raised through the same stack as a regular db error is. I'm uncertain what's the purpose of that timeout is - would it be possible to remove it?
Use case: I have an array of objects that I want to respond with during mocking. Some of these are pg.DatabaseError objects, which would require some complicated orchestration with simulateError to emit at the right time - if at all doable.
For example I have test queries that fail on first attempt due to race conditions (using serializable transactions) and succeed on the second one. It's hard to describe such a scenario with the current API as the query/binding/etc is the same, the only difference is in which order they are called.
The text was updated successfully, but these errors were encountered:
It would be nice to support throwing errors from tracker.response. It's almost working today but the setTimeout() that surrounds the internals of the Promise in Tracker._handle puts the exception in the wrong context and hence it's not raised through the same stack as a regular db error is. I'm uncertain what's the purpose of that timeout is - would it be possible to remove it?
Use case: I have an array of objects that I want to respond with during mocking. Some of these are pg.DatabaseError objects, which would require some complicated orchestration with simulateError to emit at the right time - if at all doable.
For example I have test queries that fail on first attempt due to race conditions (using serializable transactions) and succeed on the second one. It's hard to describe such a scenario with the current API as the query/binding/etc is the same, the only difference is in which order they are called.
The text was updated successfully, but these errors were encountered: