pgx icon indicating copy to clipboard operation
pgx copied to clipboard

Pgx_eof errors are hard to debug

Open brendanlong opened this issue 4 years ago • 1 comments

If the server hangs up on us, we get an annoying Pgx_eof exception with no context:

https://github.com/arenadotio/pgx/blob/master/pgx_async/src/pgx_async.ml#L70

Maybe instead of throwing an exception here, we could return a Result type and then the caller can throw a more useful exception with context about what it was doing?

brendanlong avatar Apr 08 '21 22:04 brendanlong

Looking at the code that triggered this for us, I'm suspicious that this is another issue with Pgx_async.execute_map. I'm wondering if we should just remove that since it's too confusing to debug.

Or improve the error handling it in somehow.

brendanlong avatar Apr 08 '21 22:04 brendanlong