We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f0c24c commit 5bbc92aCopy full SHA for 5bbc92a
1 file changed
src/extractors/evaluation-error-extractor.ts
@@ -1,9 +1,19 @@
1
import { BaseExtractor } from './base-extractor.js';
2
3
+function operationOutcomeMessage(resource: any): string {
4
+ const issue = resource?.issue?.[0];
5
+ const fromIssue =
6
+ issue?.details?.text ?? issue?.diagnostics ?? (issue != null ? JSON.stringify(issue) : undefined);
7
+ if (fromIssue != null) {
8
+ return fromIssue;
9
+ }
10
+ return resource != null ? JSON.stringify(resource) : 'unknown';
11
+}
12
+
13
export class EvaluationErrorExtractor extends BaseExtractor {
14
protected _process(parameter: any): any {
15
if (parameter.name === 'evaluation error') {
- return `EvaluationError:${parameter.resource.issue[0].details.text}`;
16
+ return `EvaluationError:${operationOutcomeMessage(parameter.resource)}`;
17
}
18
19
return undefined;
0 commit comments