alaisi / postgres-async-driver

Asynchronous PostgreSQL Java driver
Apache License 2.0
287 stars 38 forks source link

Error swallowing when lc_messages on PostgreSQL server is not English #52

Open walczakp opened 7 years ago

walczakp commented 7 years ago

Steps to reproduce:

After changing lc_messages to lc_messages = 'en_US.UTF-8', Observable emits error just fine. I'm attaching a Wireshark dump with exchange, that was not parsed as an error message (while it should be, see packet 6 - there is an information about error): pl_no_errors.zip.

Actually, while debugging through library code, I found something that maps error level from answer to some kind of enum. While this can work for English locale, it doesn't for all others: java.lang.IllegalArgumentException: No enum constant com.github.pgasync.impl.message.ErrorResponse.Level.BŁĄD

From what I see, there's no easy way to get non-localized error level for postgres (maybe by mapping SQLCODES), but could your library be changed to at least not swallow the exception?