You're refactoring a legacy codebase where many functions return `-1` to signal errors. Which modern Swift pattern replaces this anti-pattern?
-
A
Returning `Int?` with nil for errors, or throwing a typed Error
-
B
Using a global error code variable
-
C
Wrapping every call in a do-catch with forced try
-
D
Replacing -1 with Int.min