Skip to content

Commit

Permalink
Merge pull request #2250 from FirelyTeam/feature/2224-add-exceptionMe…
Browse files Browse the repository at this point in the history
…ssage

Binding: Add Error message to the response message
  • Loading branch information
marcovisserFurore authored Sep 21, 2022
2 parents 7ce4cc8 + 0f0ff56 commit 6818c5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ public void ErrorMessageAtExceptionInService()
var result = val.Validate(code.ToTypedElement(), vc);

result.Issue.Should()
.OnlyContain(i => i.Details.Text == "Terminology service failed while validating code 'aValue'");
.OnlyContain(i => i.Details.Text.StartsWith("Terminology service failed while validating code 'aValue': Error"));

var coding = new Coding("aSystem", "aValue");
result = val.Validate(coding.ToTypedElement(), vc);

result.Issue.Should()
.OnlyContain(i => i.Details.Text == "Terminology service failed while validating code 'aValue' (system 'aSystem')");
.OnlyContain(i => i.Details.Text.StartsWith("Terminology service failed while validating code 'aValue' (system 'aSystem'): Error"));

}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Specification/Schema/Binding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private async Task<OperationOutcome> callService(ITerminologyService svc, string
var codeText = code ?? coding?.Code ?? cc?.Coding[0]?.Code;
var systemName = system ?? coding?.System ?? cc?.Coding[0]?.System;
var systemText = systemName is null ? string.Empty : $" (system '{systemName}')";
message = $"Terminology service failed while validating code '{codeText}'{systemText}";
message = $"Terminology service failed while validating code '{codeText}'{systemText}: {tse.Message}";
}
else
{
Expand Down

0 comments on commit 6818c5a

Please sign in to comment.