Improve startup error from `runDbCheck`
Previously we would fail with a generic message suggesting to run
gargantext-init
, but that wouldn't always be the case; sometimes
there might be problems connecting to the database, and we want to
show the raw exception. This code should help diagnosing what's wrong.
It also changes the error hint to report the correct executable, as
these days we use gargantext-cli init
instead.
Specifically, I had setup my Linux version of Gargantext to use my Mac's DB (so that I wouldn't lose previous data), but with the current code on dev
we would get a misleading suggestion of running gargantext-cli init
, whereas the real problem was that I couldn't even connect to the DB. This MR fixes that by showing what's really wrong.