Remove `throw error as! Failure` TaskLocal adopts typed throws
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- swift
- Domain
- observability-sre
Research direction
Start with the withLogger implementation shown in the issue and read Swift issue 75520 for the TaskLocal typed-throws behavior. Run the project's existing tests after removing the unnecessary forced cast; done means the code compiles and the operation preserves its declared Failure type.
Written by the indexing model from the issue text.
Description
Swift issue https://github.com/swiftlang/swift/issues/75520
The code in question:
public func withLogger<Result, Failure: Error>(
_ logger: Logger,
_ operation: (Logger) throws(Failure) -> Result
) throws(Failure) -> Result {
do {
return try Logger.withTaskLocalLogger(logger) {
try operation(logger)
}
} catch {
throw error as! Failure
}
}
- Dominant language
- Swift
- Stars
- 4.1k
- Forks
- 344
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apple/swift-log
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 28/100
-
A crash-in-debug/log-in-release LogHandler for helping with the move off of process-global bootstrap Open
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
Similar issues
-
type: docs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
googleapis/google-cloud-swift#971 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla-mobile/firefox-ios#35743 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
manaflow-ai/cmux#13417 ·
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ionic-team/capacitor#8616 ·