Skip to content

Commit

Permalink
Merge pull request #647 from valydia/configure-stacktracelimit
Browse files Browse the repository at this point in the history
Increase default stack frame and make it configurable
  • Loading branch information
Baccata authored Apr 14, 2023
2 parents 90d9df2 + e093e6f commit 3da8ac3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/core/src/weaver/Result.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package weaver

import scala.util.Try

import cats.data.NonEmptyList
import cats.data.Validated.{ Invalid, Valid }

Expand Down Expand Up @@ -83,7 +85,11 @@ object Result {
.fold(className)(m => s"$className: $m")
}

val stackTraceLimit = if (location.isDefined) Some(10) else None
val maxStackFrames = sys.props.get("WEAVER_MAX_STACKFRAMES").flatMap(s =>
Try(s.trim.toInt).toOption).getOrElse(50)

val stackTraceLimit =
if (location.isDefined) Some(maxStackFrames) else None

Some(formatError(description,
Some(source),
Expand Down

0 comments on commit 3da8ac3

Please sign in to comment.