You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will make starting up the server much easier, as it'll automatically detect when something is wrong and give steps to fix it.
Description
Proactively examine the application.properties file and test the connection to both the database and the object store before Spring would throw errors, and let the user know in a more readable way what went wrong and how to fix it. We can also point them to the appropriate section in the README. Either way, it's better than what we have now. For example, if we can't establish a connection to the database, we might output:
Could not connect to the SQL database. Make sure you've specified the correct URL, username, and password in application.properties, and that the server is currently running.
If we're missing the application.properties file entirely, we currently throw an obtuse error about not being able to pick the right database driver (because it's derived from the URL, which isn't specified). With this implemented, we could show something like:
No application.properties file found. You must provide one.
We need to make sure this stays compatible with other Spring-compatible config, though, so we need to find some way to insert an init step after Spring has read the config but before any automated DB/whatever setup occurs.
Alternatives
Leaving the standard exceptions from Spring -- these are fine for developers with Spring experience who know what the errors mean and how to fix them. They're not so fine for end users trying to set up the backend without realizing they're missing something.
Trapping errors thrown by Spring on startup -- this seems to be, if not impossible, at least very difficult to do well; as far as I can tell we'd end up trapping database errors during the server's normal operation as well, which may cause issues.
The text was updated successfully, but these errors were encountered:
Goal
This will make starting up the server much easier, as it'll automatically detect when something is wrong and give steps to fix it.
Description
Proactively examine the
application.properties
file and test the connection to both the database and the object store before Spring would throw errors, and let the user know in a more readable way what went wrong and how to fix it. We can also point them to the appropriate section in the README. Either way, it's better than what we have now. For example, if we can't establish a connection to the database, we might output:If we're missing the
application.properties
file entirely, we currently throw an obtuse error about not being able to pick the right database driver (because it's derived from the URL, which isn't specified). With this implemented, we could show something like:We need to make sure this stays compatible with other Spring-compatible config, though, so we need to find some way to insert an init step after Spring has read the config but before any automated DB/whatever setup occurs.
Alternatives
The text was updated successfully, but these errors were encountered: