Skip to content

Commit

Permalink
Handle exceptions while reading the thesaurus.
Browse files Browse the repository at this point in the history
  • Loading branch information
bleroy committed Sep 5, 2019
1 parent 539f8a6 commit d02a991
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Text/Distinct/Distinct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ public static async Task<IActionResult> RunDistinct(
return new BadRequestObjectResult($"{skillName} - Invalid request record array.");
}

Thesaurus thesaurus = new Thesaurus(executionContext.FunctionAppDirectory);
try
{
Thesaurus thesaurus = new Thesaurus(executionContext.FunctionAppDirectory);
}
catch(Exception e)
{
throw new Exception("Failed to read and parse thesaurus.json.", e);
}
WebApiSkillResponse response = WebApiSkillHelpers.ProcessRequestRecords(skillName, requestRecords,
(inRecord, outRecord) =>
{
Expand Down

0 comments on commit d02a991

Please sign in to comment.