Skip to content

Commit

Permalink
[#noissue] Add fallback timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
intr3p1d committed Feb 24, 2025
1 parent 07745a5 commit f5a068d
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,21 @@ private List<ExceptionWrapperBo> mapExceptionWrapperBo(
(PException p) -> new ExceptionWrapperBo(
StringUtils.defaultIfEmpty(p.getExceptionClassName(), EMPTY),
StringUtils.defaultIfEmpty(p.getExceptionMessage(), EMPTY),
p.getStartTime(), p.getExceptionId(), p.getExceptionDepth(),
getFallbackTime(p.getStartTime(), p),
p.getExceptionId(), p.getExceptionDepth(),
handleStackTraceElements(p.getStackTraceElementList())
)
).collect(Collectors.toList());
}

private long getFallbackTime(long actual, PException p) {
if (actual > 0) {
return actual;
}
logger.warn("Invalid startTime={}, PException={}", actual, p);
return System.currentTimeMillis();
}

private List<StackTraceElementWrapperBo> handleStackTraceElements(List<PStackTraceElement> pStackTraceElements) {
return pStackTraceElements.stream().map(
(PStackTraceElement p) ->
Expand Down

0 comments on commit f5a068d

Please sign in to comment.