diff --git a/.gitignore b/.gitignore index 582643d..0d43cfc 100644 --- a/.gitignore +++ b/.gitignore @@ -374,3 +374,4 @@ FodyWeavers.xsd /SystranTests/TestFiles/Translate_output.txt /SystranTests/TestFiles/Translate_output_translated.txt /Tests.Systran/appsettings.json +/Tests.Systran/appsettings.json diff --git a/Apps.Systran/Actions/DictionaryActions.cs b/Apps.Systran/Actions/DictionaryActions.cs index 40bb05a..7877644 100644 --- a/Apps.Systran/Actions/DictionaryActions.cs +++ b/Apps.Systran/Actions/DictionaryActions.cs @@ -55,7 +55,7 @@ public async Task CreateDictionary( importEntriesRequest.AddFile("inputFile", stream.ToArray(), "ConvertedDictionary.tsv", - "text/plain"); + "text/xml"); } var importResponse = await Client.ExecuteWithErrorHandling(importEntriesRequest); diff --git a/Apps.Systran/Api/SystranClient.cs b/Apps.Systran/Api/SystranClient.cs index e4994b4..fa519b3 100644 --- a/Apps.Systran/Api/SystranClient.cs +++ b/Apps.Systran/Api/SystranClient.cs @@ -30,7 +30,7 @@ protected override Exception ConfigureErrorException(RestResponse response) if (errors != null && !string.IsNullOrEmpty(errors.Message)) { - return new($"Systran API Error: {errors.Message}"); + throw new PluginApplicationException($"Systran API Error: {errors.Message}"); } return new("Unknown error"); diff --git a/Tests.Systran/Tests.Systran.csproj b/Tests.Systran/Tests.Systran.csproj index 9433502..660a130 100644 --- a/Tests.Systran/Tests.Systran.csproj +++ b/Tests.Systran/Tests.Systran.csproj @@ -27,6 +27,9 @@ + + PreserveNewest + PreserveNewest