We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a3fecfb commit e7b5111Copy full SHA for e7b5111
Sources/SwiftJWT/JWTError.swift
@@ -52,4 +52,12 @@ public struct JWTError: Error, Equatable {
52
public static func == (lhs: JWTError, rhs: JWTError) -> Bool {
53
return lhs.internalError == rhs.internalError
54
}
55
+
56
+ /// Function to enable pattern matching against generic Errors.
57
+ public static func ~= (lhs: JWTError, rhs: Error) -> Bool {
58
+ guard let rhs = rhs as? JWTError else {
59
+ return false
60
+ }
61
+ return lhs == rhs
62
63
0 commit comments