public async Task <IActionResult> GetFeaturedProducts() { try { var featuredProducts = await _dbServices.GetFeaturedProductsAsync(); return(StatusCode(200, featuredProducts)); } catch (SqlException se) { #if DEBUG return(StatusCode(400, se)); #else return(StatusCode(400, $"A sql related error has occurred while attempting to get featured products")); #endif } catch (Exception ex) { #if DEBUG return(StatusCode(500, ex)); #else return(StatusCode(500, $"A generic exception was caught while attempting to retrieve featured products")); #endif } }