Обработка исключения FileFormatException при импорте РТК-план

This commit is contained in:
parent 84d84fb504
commit 93c230db72

View File

@ -204,11 +204,18 @@ namespace AsbCloudWebApi.Controllers
using Stream stream = file.OpenReadStream();
await processMapPlanImportService.ImportAsync(idWell,
idUser.Value,
(options & 1) > 0,
stream,
cancellationToken);
try
{
await processMapPlanImportService.ImportAsync(idWell,
idUser.Value,
(options & 1) > 0,
stream,
cancellationToken);
}
catch (FileFormatException ex)
{
return BadRequest(ex.Message);
}
return Ok();
}