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

Make better error when Electric can't connect to the database #1825

Closed
KyleAMathews opened this issue Oct 9, 2024 · 2 comments
Closed

Make better error when Electric can't connect to the database #1825

KyleAMathews opened this issue Oct 9, 2024 · 2 comments

Comments

@KyleAMathews
Copy link
Contributor

Right now if you type the wrong database name in your postgres string, you'll get the following error:

** (Postgrex.Error) ERROR 55000 (object_not_in_prerequisite_state) replication slot "electric_slot_default" was not created in this database

Instead we should just say something more helpful like that we could connect but the database name isn't correct. I'm assuming we are connecting but then the replication slot creation fails — so we could put in a check that the database exists first.

@KyleAMathews KyleAMathews added this to the Production Readiness milestone Oct 9, 2024
@robacourt
Copy link
Contributor

I just tried in main (d43c375) and got:

09:29:26.784 [warning] Database connection in lock_connection mode failed: database "wibble" does not exist (PG code: 3D000, PG routine: InitPostgres)

Which is already pretty helpful.

@balegas
Copy link
Contributor

balegas commented Oct 28, 2024

I think that's fine. People might not know what lock_connection is but message is fine.

@balegas balegas closed this as completed Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants