Improve error handling a bit

This commit is contained in:
Nikolaj Olsson 2018-12-09 09:04:33 +01:00
parent d0454b7fa3
commit dd8a29d546
2 changed files with 7 additions and 1 deletions

View File

@ -249,6 +249,12 @@ namespace Nikse.SubtitleEdit.Forms
Environment.NewLine +
webException.Source + ": " + webException.Message);
}
else if (translator.GetType() == typeof(GoogleTranslator2) && webException.Message.Contains("(400) Bad Request"))
{
MessageBox.Show("API key invalid - perhaps billing is not enabled?" + Environment.NewLine +
Environment.NewLine +
webException.Source + ": " + webException.Message);
}
else
{
MessageBox.Show(webException.Source + ": " + webException.Message);

View File

@ -2620,7 +2620,7 @@ namespace Nikse.SubtitleEdit.Forms
private void linkLabelGoogleTranslateSignUp_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start("https://cloud.google.com/docs/authentication/api-keys");
Process.Start("https://www.google.com/search?q=google+cloud+get+api+key");
}
}
}