Jellyfish-Insights / andromeda

Don’t be held hostage by other providers. Own and aggregate your data from organic and paid campaigns in a single place to pull and review as needed
http://jellyfishinsights.com/
Apache License 2.0
11 stars 5 forks source link

Exception when we can not connect to a database #35

Closed leonardo-brickabode closed 2 years ago

leonardo-brickabode commented 4 years ago

Describe the bug 🐛

When the user doesn't have set up the database properly and tries to run any Job, he receives the following unhandled exception instead of an informative message about the error.

To Reproduce

Having the credentials setup but without any database set up properly:

  1. Go to src/ConsoleApp
  2. Execute dotnet run jobs -t Fetcher
  3. See error

Expected behavior 🤔 Instead of an unhandled exception, receive an informative message about the cause of the error.

Screenshots

Unhandled Exception: Npgsql.PostgresException: 28P01: password authentication failed for user "fee"
   at Npgsql.NpgsqlConnector.<>c__DisplayClass161_0.<<ReadMessage>g__ReadMessageLong|0>d.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlConnector.cs:line 1003
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlConnector.<>c__DisplayClass161_0.<<ReadMessage>g__ReadMessageLong|0>d.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlConnector.cs:line 1032
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlConnector.AuthenticateMD5(String username, Byte[] salt, Boolean async) in C:\projects\npgsql\src\Npgsql\NpgsqlConnector.Auth.cs:line 132
   at Npgsql.NpgsqlConnector.Authenticate(String username, NpgsqlTimeout timeout, Boolean async) in C:\projects\npgsql\src\Npgsql\NpgsqlConnector.Auth.cs:line 38
   at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) in C:\projects\npgsql\src\Npgsql\NpgsqlConnector.cs:line 425
   at Npgsql.ConnectorPool.AllocateLong(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) in C:\projects\npgsql\src\Npgsql\ConnectorPool.cs:line 246
   at Npgsql.NpgsqlConnection.<>c__DisplayClass32_0.<<Open>g__OpenLong|0>d.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlConnection.cs:line 300
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlConnection.Open() in C:\projects\npgsql\src\Npgsql\NpgsqlConnection.cs:line 153
   at ConsoleApp.Commands.ExportData.QueryFacebook() in /home/user/jellyfish/src/ConsoleApp/Commands/ExportData.cs:line 26
   at ConsoleApp.Program.<>c.<Main>b__0_19() in /home/user/jellyfish/src/ConsoleApp/Program.cs:line 202
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at ConsoleApp.Program.Main(String[] args) in /home/user/jellyfish/src/ConsoleApp/Program.cs:line 209

Your environment

Additional context

moraesvic commented 2 years ago

Closing because the project context changed too much since then