From 9c410308402a1bdeebbb2415ba58f7512657ef47 Mon Sep 17 00:00:00 2001 From: Kasdejong Date: Wed, 3 Apr 2024 15:01:29 +0200 Subject: [PATCH] Exception is now an argumentException --- src/Hl7.Fhir.Base/Rest/BaseFhirClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hl7.Fhir.Base/Rest/BaseFhirClient.cs b/src/Hl7.Fhir.Base/Rest/BaseFhirClient.cs index 705e20f0d1..2a6d40b83b 100644 --- a/src/Hl7.Fhir.Base/Rest/BaseFhirClient.cs +++ b/src/Hl7.Fhir.Base/Rest/BaseFhirClient.cs @@ -856,7 +856,7 @@ private static ResourceIdentity verifyResourceIdentity(Uri location, bool needId // either msg or entryComponent should be set private async Task extractResourceFromHttpResponse(IEnumerable expect, HttpResponseMessage responseMessage, HttpRequestMessage? msg = null, Bundle.EntryComponent? entryComponent = null) where TResource : Resource { - if (msg is null && entryComponent is null) throw new InvalidOperationException("Either msg or entryComponent must be set"); + if (msg is null && entryComponent is null) throw new ArgumentException("Either msg or entryComponent should be set"); // Validate the response and throw the appropriate exceptions. Also, if we have *not* verified the FHIR version // of the server, add a suggestion about this in the (legacy) parsing exception. var suggestedVersionOnParseError = !Settings.VerifyFhirVersion ? fhirVersion : null;