diff --git a/src/main/java/com/nhn/pinpoint/common/bo/SpanBo.java b/src/main/java/com/nhn/pinpoint/common/bo/SpanBo.java index e13a9b3c0..6d4588ec8 100644 --- a/src/main/java/com/nhn/pinpoint/common/bo/SpanBo.java +++ b/src/main/java/com/nhn/pinpoint/common/bo/SpanBo.java @@ -91,13 +91,17 @@ public class SpanBo implements com.nhn.pinpoint.common.bo.Span { this.errCode = span.getErr(); this.remoteAddr = span.getRemoteAddr(); - - final TIntStringValue exceptionInfo = span.getExceptionInfo(); - if (exceptionInfo != null) { - this.hasException = true; - this.exceptionId = exceptionInfo.getIntValue(); - this.exceptionMessage = exceptionInfo.getStringValue(); - } + + if (span.isSetErr()) { + this.hasException = true; + // FIXME span.errCode는 span과 spanEvent의 에러를 모두 포함한 값. + // exceptionInfo는 span자체의 에러정보이기 때문에 errCode가 0이 아니더라도 exceptionInfo는 null일 수 있음. + final TIntStringValue exceptionInfo = span.getExceptionInfo(); + if (exceptionInfo != null) { + this.exceptionId = exceptionInfo.getIntValue(); + this.exceptionMessage = exceptionInfo.getStringValue(); + } + } setAnnotationList(span.getAnnotations()); }