Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
walczakp opened this issue Aug 30, 2017 · 0 comments
Open

Comments

@walczakp
Copy link

Steps to reproduce:

  • set eg. lc_messages = 'Polish_Poland.1250' in postgresql.conf
  • do a tx.querySet with SQL query that generates error on PostgreSQL server side (I tested with foreign key violation)
  • resulting Observable does not emit any error and even tx.commit works fine

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant