pgx
pgx copied to clipboard
Pgx_eof errors are hard to debug
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?
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.