Skip to content

Commit

Permalink
Better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliy-bezugly committed Mar 20, 2024
1 parent 8ec1070 commit 75c0bba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Apps.Lionbridge/Actions/SupportAssetsActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task<SupportAssetResponse> AddSupportAsset([ActionParameter] GetJob
var apiRequest = new LionbridgeRequest(endpoint, Method.Post)
.AddJsonBody(new
{
fmsFileId = uploadResponse.FmsFileId,
fmsFileId = uploadResponse.FmsFileId ?? throw new Exception("FMS file ID is missing"),
description = addSupportAssetRequest.Description,
sourceNativeIds = addSupportAssetRequest.SourceNativeIds ?? new List<string> { Guid.NewGuid().ToString() },
sourceNativeLanguageCode = addSupportAssetRequest.SourceNativeLanguageCode,
Expand Down
2 changes: 1 addition & 1 deletion Apps.Lionbridge/LionbridgeInvocable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected async Task<UploadSourceFileResponse> UploadFmsFile(string jobId, AddFi
string fmsMultipartUrl = response.FmsPostMultipartUrl;

var fileStream = await fileManagementClient.DownloadAsync(fileRequest.File);
var memoryStream = new MemoryStream();
using var memoryStream = new MemoryStream();
await fileStream.CopyToAsync(memoryStream);

var bytes = memoryStream.ToArray();
Expand Down

0 comments on commit 75c0bba

Please sign in to comment.