Foundation overloads the pattern matching operator ~= to enable matching against error codes in catch clauses. Foundation includes an overload for the pattern matching operator ~= that matches error values against error codes. Code , error : any Error ) -> Bool { guard let error = error as?