Sample Program PostgresSql problem?

Hello;
Running the example program PostgresSQL Example in 2024R2 on a mac , when I hit hit -Connect to PostgresSQL- I expect to get an error message as I am not running a server to connect to.

Instead the program throws a Database exception error. Here is the code from the example.

Thanks

mDb = New PostgreSQLDatabase

mDb.Host = "localhost"
mDb.UserName = "postgres"
mDb.Password = "password"
mDb.AppName = App.ExecutableFile.Name
mDb.DatabaseName = "postgres"

Try
  mDb.Connect
Catch err As DatabaseException
  mIsConnected = False
  ConnectStatusLabel.Text = "Error connecting to PostgreSQL: " + err.Message
  Return
End Try

mIsConnected = True
ConnectStatusLabel.Text = "Connected to PostgreSQL!"

If you are debugging, you may have ‘break on exceptions’ option and that is why the debugger stops at the exception.

Your try…catch will catch the exception if you resume debugging. Your app will not break and it should go directly to the catch err section.

Perfect, that was it. Thanks.