Skip to content

Commit

Permalink
refactor: replace exception with return value
Browse files Browse the repository at this point in the history
  • Loading branch information
EddeCCC committed Oct 14, 2024
1 parent 9266d45 commit 72c2b42
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ public static boolean spanAlreadyExists(String spanName)
if (Objects.isNull(SDKSPAN_CLASS)) return false;

Span span = Span.current();
if (!SDKSPAN_CLASS.isInstance(span))
throw new IllegalArgumentException("The provided Span is not an instance of SdkSpan.");
if (!SDKSPAN_CLASS.isInstance(span)) return false;

Object sdkSpan = SDKSPAN_CLASS.cast(span);
Method toSpanData = SDKSPAN_CLASS.getDeclaredMethod("toSpanData");
Expand Down

0 comments on commit 72c2b42

Please sign in to comment.