mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 19:22:53 +01:00
More error handling
This commit is contained in:
parent
74521204ae
commit
6651249cef
@ -55,6 +55,12 @@ namespace Nikse.SubtitleEdit.Core.AutoTranslate
|
||||
var result = _httpClient.GetAsync(url).Result;
|
||||
var bytes = result.Content.ReadAsByteArrayAsync().Result;
|
||||
jsonResultString = Encoding.UTF8.GetString(bytes).Trim();
|
||||
|
||||
if (!result.IsSuccessStatusCode)
|
||||
{
|
||||
Error = jsonResultString;
|
||||
SeLogger.Error($"Error in {StaticName}.Translate: " + Error);
|
||||
}
|
||||
}
|
||||
catch (WebException webException)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user