rajeshkumarchandolu commented on code in PR #12145:
URL: https://github.com/apache/ozone/pull/12145#discussion_r4706320528
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java:
##########
@@ -586,20 +590,20 @@ public static Span createSpan(String spanName, SpanKind
spanKind) {
return buildSpan(spanName, spanKind);
}
- public static void recordExceptionInCurrentSpan(Throwable t) {
- recordException(Span.current(), t);
+ public static void recordErrorInCurrentSpan(Throwable t) {
+ recordError(Span.current(), t);
}
- public static void recordException(Span span, Throwable t) {
- if (t == null || !span.isRecording()) {
+ public static void recordError(Span span, Throwable t) {
+ if (!span.isRecording()) {
return;
}
- span.recordException(t);
- if (t.getMessage() == null) {
+ if (t == null) {
span.setStatus(StatusCode.ERROR);
- } else {
- span.setStatus(StatusCode.ERROR, t.getMessage());
+ return;
}
+ span.recordException(t);
+ span.setStatus(StatusCode.ERROR, t.getMessage());
Review Comment:
setStatus is already doing it internally
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]