Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoggerStore invalid Error type when storing request #102

Closed
damirstuhec opened this issue Aug 19, 2022 · 2 comments
Closed

LoggerStore invalid Error type when storing request #102

damirstuhec opened this issue Aug 19, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@damirstuhec
Copy link

damirstuhec commented Aug 19, 2022

Description

Current definition of storeRequest(_:response:error:data:metrics:) in LoggerStore is expecting the error argument to be of type Error, which resolves to the internal LoggerStore.Error, preventing us to pass Swift.Error into the method like we could pre v2.0.

It seems like an oversight that is further suggested by the implementation of the storeRequest method which maps Swift.Error into the NetworkLogger.ResponseError.

Expectation

Unless I'm missing something, the method definition should look like this public func storeRequest(_ request: URLRequest, response: URLResponse?, error: Swift.Error?, data: Data?, metrics: URLSessionTaskMetrics? = nil). Note the explicit Swift.Error error type.

@kean
Copy link
Owner

kean commented Aug 19, 2022

It's an unintended change. Thanks for reporting it.

@kean kean added the bug Something isn't working label Aug 19, 2022
@kean
Copy link
Owner

kean commented Aug 20, 2022

Fixed in 2.0.2

@kean kean closed this as completed Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants