We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8371d9d commit 7f7a769Copy full SHA for 7f7a769
Sources/Diagnose/RequestInfo.swift
@@ -70,11 +70,12 @@ public struct RequestInfo {
70
"key.offset: "
71
Capture(ZeroOrMore(.digit))
72
}
73
- guard let offsetMatch = requestTemplate.matches(of: offsetRegex).only else {
74
- throw ReductionError("Failed to find key.offset in the request")
+ if let offsetMatch = requestTemplate.matches(of: offsetRegex).only {
+ offset = Int(offsetMatch.1)!
75
+ requestTemplate.replace(offsetRegex, with: "key.offset: $OFFSET")
76
+ } else {
77
+ offset = 0
78
- offset = Int(offsetMatch.1)!
- requestTemplate.replace(offsetRegex, with: "key.offset: $OFFSET")
79
80
// Extract source file
81
let sourceFileRegex = Regex {
0 commit comments