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

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

View File

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