Browse Source

removed the manual exception handling

pull/118/head
malik masis 4 years ago
parent
commit
4ccb4e31f1
  1. 14
      apps/public-web/src/EShopOnAbp.PublicWeb/Pages/ProductDetail.cshtml.cs

14
apps/public-web/src/EShopOnAbp.PublicWeb/Pages/ProductDetail.cshtml.cs

@ -12,9 +12,8 @@ namespace EShopOnAbp.PublicWeb.Pages
public int OrderNo { get; set; }
public ProductDto Product { get; private set; }
public bool HasRemoteServiceError { get; set; } = false;
private readonly IPublicProductAppService _productAppService;
private readonly IPublicProductAppService _productAppService;
public ProductDetailModel(IPublicProductAppService productAppService)
{
@ -23,16 +22,7 @@ namespace EShopOnAbp.PublicWeb.Pages
public async Task OnGet(Guid id)
{
try
{
Product = await _productAppService.GetAsync(id);
}
catch (Exception e)
{
Product = new ProductDto();
HasRemoteServiceError = true;
Console.WriteLine(e);
}
Product = await _productAppService.GetAsync(id);
}
}
}
Loading…
Cancel
Save