public async Task <ActionResult <Food> > FindByBarcode([FromRoute] string barcode) { try { return(await _foodService.FindByBarcode(barcode)); } catch (LaprTrackrException ex) { _logger.LogDebug(ex.Message); return(ex.GetActionResult()); } catch (Exception ex) { const string message = "Failed to find food"; _logger.LogError(ex, message); return(new LaprTrackrException(LaprTrackrStatusCodes.ServiceUnavailable, message).GetActionResult()); } }