Closed wmcginty closed 6 years ago
Merging #38 into release/2.0.0 will increase coverage by
0.14%
. The diff coverage is88.23%
.
@@ Coverage Diff @@
## release/2.0.0 #38 +/- ##
=================================================
+ Coverage 95.67% 95.82% +0.14%
=================================================
Files 27 26 -1
Lines 810 814 +4
=================================================
+ Hits 775 780 +5
+ Misses 35 34 -1
Impacted Files | Coverage Δ | |
---|---|---|
...per/Test Defaults/NetworkRequestTestDefaults.swift | 100% <ø> (ø) |
:arrow_up: |
...space/Service/Network/NetworkServiceProtocol.swift | 96.15% <ø> (ø) |
:arrow_up: |
...erspace/Service/Backend/BackendServiceHelper.swift | 100% <100%> (ø) |
:arrow_up: |
Tests/BackendServiceTests.swift | 98.64% <100%> (-0.02%) |
:arrow_down: |
Sources/Hyperspace/Request/NetworkRequest.swift | 100% <100%> (ø) |
:arrow_up: |
...es/Hyperspace/Service/Backend/BackendService.swift | 100% <100%> (ø) |
:arrow_up: |
Tests/Helper/Mocks/MockBackendService.swift | 60% <75%> (+60%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 5540946...e586451. Read the comment docs.
@tylermilner I put a CHANGELOG.md
entry together. I can look at creating a migration guide as we get closer to 2.0 release.
Looks good. Maybe just merge this into a release
branch so that we're not touching master
until we're ready to release version 2.0?
Switched over to merge back into release. Should be good to go now.
This should help address #28 .
Changes made:
NetworkServiceFailureInitializable
(not sold on the name). This is any error that can be initialized from aNetworkServiceFailure
as so:init(networkServiceFailure:)
DecodingFailureInitializable
(not sold on the name). This is any error that can be initialized from a failed Codable decode as so:init(decodingError:data:)
.BackendServiceError
. It is now only implemented in tests.NetworkRequest
,ErrorType
, which must beNetworkServiceFailureInitializable
.AnyError has been expanded to conform to this protocol, so
AnyNetworkRequestThis combination of changes allows for a few improvements:
NetworkService
creates any sort of failure response, instead of getting a genericBackendServiceError
,NetworkRequest.ErrorType.init
is called with the reason for the failure. This should give easy access to theData
in the failure (and any other part of it).NetworkRequest.ResponseType
conforms toCodable
and fails to decode,NetworkRequest.ErrorType.init
can be called with both the failure and the data attempting to be decoded. There is an extension to apply a default for whenNetworkRequest.ErrorType
conforms toDecodingFailureInitializable
.Oh, and it changes the interface significantly enough that, if approved, we'll want to roll it up with some of the other proposed v2 changes.