The main motivation was addressing static analysis warnings I encountered when analyzing an Objective-C project. The error handling was just something I fixed along the way.
Note: I also added a couple of missing generics annotations which may affect the public interface. If they are imported into Swift, they will go from [Any] to [OHHTTPStubsDescriptor]. ~This is a breaking change for anyone who is using the output of this method in Swift.~ Actually, it may not be breaking, since in Swift, they were probably already doing something like for descriptor in descriptors as! [OHHTTPStubsDescriptor], and after this update, that line will throw a compile warning, not an error. So this can probably be a bugfix, not a major release.
Testing: I added a couple of missing tests for error throwing cases, and made sure all the tests were passing.
Checklist
Description
Fixes #290
Also does more idiomatic error handling:
Wrong:
Correct:
Motivation and Context
The main motivation was addressing static analysis warnings I encountered when analyzing an Objective-C project. The error handling was just something I fixed along the way.
Note: I also added a couple of missing generics annotations which may affect the public interface. If they are imported into Swift, they will go from
[Any]
to[OHHTTPStubsDescriptor]
. ~This is a breaking change for anyone who is using the output of this method in Swift.~ Actually, it may not be breaking, since in Swift, they were probably already doing something likefor descriptor in descriptors as! [OHHTTPStubsDescriptor]
, and after this update, that line will throw a compile warning, not an error. So this can probably be a bugfix, not a major release.Testing: I added a couple of missing tests for error throwing cases, and made sure all the tests were passing.