public async Task <IActionResult> Parse(string parseUrl) { // validate parseUrl if (!Uri.IsWellFormedUriString(parseUrl, UriKind.Absolute)) { return(BadRequest("This service requires a well formed url to parse.")); } try { var pageSummary = await _parserService.ParsePageAsync(parseUrl); return(Ok(pageSummary)); } catch (Exception ex) { //log error _logger.LogError($"Failed to parse page({parseUrl}): {ex}"); return(BadRequest("We've had a catastrophic error. Our minions are looking at it now. We appreciate your patience.")); } }