Skip to content

Commit 1853c6f

Browse files
committed
Rename _startCachingForThrownErrors since it shows up in backtraces, make it clearer what it's there for
1 parent 8947a4e commit 1853c6f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sources/Testing/SourceAttribution/Backtrace.swift

+5-2
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,10 @@ extension Backtrace {
192192

193193
/// The implementation of ``Backtrace/startCachingForThrownErrors()``, run
194194
/// only once.
195-
private static let _startCachingForThrownErrors: Void = {
195+
///
196+
/// This value is named oddly so that it shows up clearly in symbolicated
197+
/// backtraces.
198+
private static let __SWIFT_TESTING_IS_CAPTURING_A_BACKTRACE_FOR_A_THROWN_ERROR__: Void = {
196199
_oldWillThrowHandler.withLock { oldWillThrowHandler in
197200
oldWillThrowHandler = swt_setWillThrowHandler { errorAddress in
198201
let backtrace = Backtrace.current()
@@ -208,7 +211,7 @@ extension Backtrace {
208211
/// developer-supplied code to ensure that thrown errors' backtraces are
209212
/// always captured.
210213
static func startCachingForThrownErrors() {
211-
_startCachingForThrownErrors
214+
__SWIFT_TESTING_IS_CAPTURING_A_BACKTRACE_FOR_A_THROWN_ERROR__
212215
}
213216

214217
/// Flush stale entries from the error-mapping cache.

0 commit comments

Comments
 (0)