mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-07 21:38:15 +00:00
better control over diagnostics in language error messages
This commit is contained in:
parent
7aae2cb525
commit
bb3a33d9e4
@ -1469,6 +1469,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
|
||||
} catch (TerminologyServiceProtectionException e) {
|
||||
OperationOutcomeIssueComponent iss = new OperationOutcomeIssueComponent(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.ERROR, e.getType());
|
||||
iss.getDetails().setText(e.getMessage());
|
||||
iss.setDiagnostics(e.getDiagnostics());
|
||||
issues.add(iss);
|
||||
return new ValidationResult(IssueSeverity.FATAL, e.getMessage(), e.getError(), issues);
|
||||
} catch (Exception e) {
|
||||
@ -1752,6 +1753,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
|
||||
} catch (TerminologyServiceProtectionException e) {
|
||||
OperationOutcomeIssueComponent iss = new OperationOutcomeIssueComponent(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.ERROR, e.getType());
|
||||
iss.getDetails().setText(e.getMessage());
|
||||
iss.setDiagnostics(e.getDiagnostics());
|
||||
issues.add(iss);
|
||||
return new ValidationResult(IssueSeverity.FATAL, e.getMessage(), e.getError(), issues);
|
||||
} catch (Exception e) {
|
||||
|
@ -19,12 +19,19 @@ public class TerminologyOperationContext {
|
||||
|
||||
private TerminologyServiceErrorClass error;
|
||||
private IssueType type;
|
||||
private String diagnostics;
|
||||
|
||||
public TerminologyServiceProtectionException(String message, TerminologyServiceErrorClass error, IssueType type) {
|
||||
super(message);
|
||||
this.error = error;
|
||||
this.type = type;
|
||||
}
|
||||
public TerminologyServiceProtectionException(String message, TerminologyServiceErrorClass error, IssueType type, String diagnostics) {
|
||||
super(message);
|
||||
this.error = error;
|
||||
this.type = type;
|
||||
this.diagnostics = diagnostics;
|
||||
}
|
||||
|
||||
public TerminologyServiceErrorClass getError() {
|
||||
return error;
|
||||
@ -33,6 +40,9 @@ public class TerminologyOperationContext {
|
||||
public IssueType getType() {
|
||||
return type;
|
||||
}
|
||||
public String getDiagnostics() {
|
||||
return diagnostics;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -816,7 +816,7 @@ public class ValueSetValidator extends ValueSetProcessBase {
|
||||
try {
|
||||
LanguageTag tag = new LanguageTag(registry, t.getLang());
|
||||
} catch (Exception e) {
|
||||
throw new TerminologyServiceProtectionException("Invalid displayLanguage: '"+options.getLanguages().getSource()+"'", TerminologyServiceErrorClass.PROCESSING, IssueType.PROCESSING);
|
||||
throw new TerminologyServiceProtectionException(context.formatMessage(I18nConstants.INVALID_DISPLAY_NAME, options.getLanguages().getSource()), TerminologyServiceErrorClass.PROCESSING, IssueType.PROCESSING, e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user