Skip to content

Commit

Permalink
fix findLineNumber function
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-bli committed Jul 24, 2024
1 parent eb32917 commit a4a8cb0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,16 @@ object OpenTelemetry extends Logging {
private def findLineNumber(stacks: Array[StackTraceElement]): (String, Int) = {
var index: Int = 0
// start with OpenTelemetry class
while (stacks(index).getFileName != "OpenTelemetry.scala" && index < stacks.length) {
while (index < stacks.length && stacks(index).getFileName != "OpenTelemetry.scala") {
index += 1
}
if (index == stacks.length) {
// if can't find open telemetry class, make it N/A
("N/A", 0)
} else {
while ((stacks(index).getClassName.startsWith("com.snowflake.snowpark.") ||
stacks(index).getClassName.startsWith("com.snowflake.snowpark_java.")) &&
index < stacks.length) {
while (index < stacks.length &&
(stacks(index).getClassName.startsWith("com.snowflake.snowpark.") ||
stacks(index).getClassName.startsWith("com.snowflake.snowpark_java."))) {
index += 1
}
if (index == stacks.length) {
Expand Down

0 comments on commit a4a8cb0

Please sign in to comment.