File tree Expand file tree Collapse file tree
sentry/src/main/java/io/sentry Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1134,22 +1134,14 @@ private void recordLostTransactionAndSpans(final @NotNull SentryTransaction tran
11341134
11351135 final @ Nullable Object httpStatusCodeValue =
11361136 trace .getData ().get (SpanDataConvention .HTTP_STATUS_CODE_KEY );
1137- final int httpStatusCode ;
1138- if (httpStatusCodeValue instanceof Integer ) {
1139- httpStatusCode = (Integer ) httpStatusCodeValue ;
1140- } else if (httpStatusCodeValue instanceof Long ) {
1141- final long longHttpStatusCode = (Long ) httpStatusCodeValue ;
1142- if (longHttpStatusCode < 100 || longHttpStatusCode > 599 ) {
1143- return null ;
1144- }
1145- httpStatusCode = (int ) longHttpStatusCode ;
1146- } else {
1137+ if (!(httpStatusCodeValue instanceof Integer || httpStatusCodeValue instanceof Long )) {
11471138 return null ;
11481139 }
1149-
1150- if (httpStatusCode < 100 || httpStatusCode > 599 ) {
1140+ final long longHttpStatusCode = (( Number ) httpStatusCodeValue ). longValue ();
1141+ if (longHttpStatusCode < 100 || longHttpStatusCode > 599 ) {
11511142 return null ;
11521143 }
1144+ final int httpStatusCode = (int ) longHttpStatusCode ;
11531145 for (final @ Nullable HttpStatusCodeRange ignoredHttpStatusCode : ignoredHttpStatusCodes ) {
11541146 if (ignoredHttpStatusCode != null && ignoredHttpStatusCode .isInRange (httpStatusCode )) {
11551147 return httpStatusCode ;
You can’t perform that action at this time.
0 commit comments