(MainWindow.AddDBLayer): When the layer can't be created, return immediately after displaying the error message.