File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
auto-instrumentation/+opentelemetry/+autoinstrument Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ function handleError(obj, ME)
150150 % spans and their corresponding scopes. Rethrow the
151151 % exception ME.
152152 if ~isempty(obj .Instrumentor .Spans )
153- setStatus(obj .Instrumentor .Spans(end ), " Error" );
153+ setStatus(obj .Instrumentor .Spans(end ), " Error" , ME . message );
154154 for i = length(obj .Instrumentor .Spans ): -1 : 1
155155 obj .Instrumentor .Spans(i ) = [];
156156 obj .Instrumentor .Scopes(i ) = [];
@@ -195,4 +195,4 @@ function handleError(obj, ME)
195195 % file
196196 f = processFileInput(f );
197197end
198- end
198+ end
Original file line number Diff line number Diff line change @@ -253,6 +253,8 @@ function testError(testCase)
253253
254254 % check error status
255255 verifyEqual(testCase , results{1 }.resourceSpans.scopeSpans.spans.status.code, 2 ); % error
256+ verifyEqual(testCase , results{1 }.resourceSpans.scopeSpans.spans.status.message, ...
257+ ' Input must be a numeric scalar' );
256258 verifyEmpty(testCase , fieldnames(results{2 }.resourceSpans.scopeSpans.spans.status)); % ok, no error
257259 end
258260
@@ -287,6 +289,8 @@ function testHandleError(testCase)
287289
288290 % check error status
289291 verifyEqual(testCase , results{1 }.resourceSpans.scopeSpans.spans.status.code, 2 ); % error
292+ verifyEqual(testCase , results{1 }.resourceSpans.scopeSpans.spans.status.message, ...
293+ ' Input must be a numeric scalar' );
290294 verifyEmpty(testCase , fieldnames(results{2 }.resourceSpans.scopeSpans.spans.status)); % ok, no error
291295 end
292296
You can’t perform that action at this time.
0 commit comments