public async Task<IList<CategoryContract>> GetAsync()
{
try
{
_telemetryClient.TrackEvent("CategoryController GetAsync invoked");
var categories = await _repository.GetCategories();
return categories;
}
catch (DataLayerException ex)
{
_telemetryClient.TrackException(ex);
if (ex.Error == DataLayerError.Unknown)
{
throw ServiceExceptions.UnknownInternalFailureException(ServiceExceptions.Source);
}
throw ServiceExceptions.DataLayerException(ex.Message);
}
}