diff --git a/FitConnect/Subscriber.cs b/FitConnect/Subscriber.cs index 144b8efb73cb96a5e49228d55eb1980dff18083a..766cc21ad016f94b297ba44703a96af785536432 100644 --- a/FitConnect/Subscriber.cs +++ b/FitConnect/Subscriber.cs @@ -114,7 +114,17 @@ public class Subscriber : FitConnectClient, throw new SecurityEventException(problem); } - var schema = JsonSchema.FromUrlAsync(submission.Metadata?.Schema).Result; + JsonSchema? schema; + try { + schema = JsonSchema.FromUrlAsync(submission.Metadata?.Schema).Result; + } + catch (Exception e) { + // SuccessCriteria:3.5 + var problem = new Problems(Problems.ProblemTypeEnum.UnsupportedSchema, + Problems.DetailUnsupportedSchema); + throw new SecurityEventException(problem, e); + } + VerifyMetadata(submission, metadataString, schema); // SuccessCriteria:3.3