steamclock / netable

A Swift library for encapsulating network APIs using Codable in a type-oriented way.
MIT License
99 stars 3 forks source link

Fix successful request log event not correctly printing finalized data #71

Closed brendanlensink closed 3 years ago

brendanlensink commented 3 years ago

LogEvent.requestSuccess expects finalizedResult: Any, but we were passing in Result<Any, NetableError> which was causing problems when we were trying to unwrap and print the finalized result.

I think there might be a more elegant way to do this, where we pass the whole result into .requestSuccess and then print a different message depending on whether the decoding was a success or not, because I think you could make an argument the request has succeeded either way, but I couldn't get it to work and I'm not sure it's worth dwelling on.