diff --git a/CHANGELOG.md b/CHANGELOG.md index dc25532..a439328 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [0.10.3] - 12-01-21 +### Changed +- Fixed an issue with logging successful requests that was preventing finalized data from being printed properly. +- Fixed a couple small tpyos. + ## [0.10.2] - 10-08-20 ### Added - Added support for `DELETE` requests. diff --git a/Netable.podspec b/Netable.podspec index 548a644..63a03f0 100644 --- a/Netable.podspec +++ b/Netable.podspec @@ -1,12 +1,12 @@ Pod::Spec.new do |s| s.name = 'Netable' - s.version = '0.10.2' + s.version = '0.10.3' s.summary = 'A simple and swifty networking library.' s.description = 'Netable is a simple Swift framework for working with both simple and non-REST-compliant HTTP endpoints.' s.homepage = 'https://github.com/steamclock/netable/' s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { 'Brendan Lensink' => 'brendan@steamclock.com' } - s.source = { :git => 'https://github.com/steamclock/netable.git', :tag => 'v0.10.2' } + s.source = { :git => 'https://github.com/steamclock/netable.git', :tag => 'v0.10.3' } s.ios.deployment_target = '11.0' s.osx.deployment_target = '10.14' s.source_files = 'Netable/Netable/*.{swift,h,m}' diff --git a/Netable/Netable.xcodeproj/project.pbxproj b/Netable/Netable.xcodeproj/project.pbxproj index e329b17..07d8931 100644 --- a/Netable/Netable.xcodeproj/project.pbxproj +++ b/Netable/Netable.xcodeproj/project.pbxproj @@ -686,7 +686,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 0.10.2; + MARKETING_VERSION = 0.10.3; PRODUCT_BUNDLE_IDENTIFIER = com.steamclock.Netable; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -716,7 +716,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 0.10.2; + MARKETING_VERSION = 0.10.3; PRODUCT_BUNDLE_IDENTIFIER = com.steamclock.Netable; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; diff --git a/Netable/Netable/LogDestination.swift b/Netable/Netable/LogDestination.swift index f286d4f..ef94fe3 100644 --- a/Netable/Netable/LogDestination.swift +++ b/Netable/Netable/LogDestination.swift @@ -29,9 +29,9 @@ public enum LogEvent: CustomDebugStringConvertible { /// Request has been successfully initiated. case requestStarted(request: RequestInfo) - /// Request has sucessfully completed. + /// Request has successfully completed. /// Note: taskTime only covers the time it took the current network request to run, in retry scenarios the time for the whole request may be longer. - case requestSuccess(request: RequestInfo, taskTime: TimeInterval, statusCode: Int, responseData: Data?, finalizedResult: Any?) + case requestSuccess(request: RequestInfo, taskTime: TimeInterval, statusCode: Int, responseData: Data?, finalizedResult: Any) /// Sent when a request fails but will be retried. Note: taskTime only cover the time it took the current network request to run, in retry scenarios the time for the whole request may be longer. case requestRetrying(request: RequestInfo, taskTime: TimeInterval, error: NetableError) diff --git a/Netable/Netable/Netable.swift b/Netable/Netable/Netable.swift index bfda176..42ca33b 100644 --- a/Netable/Netable/Netable.swift +++ b/Netable/Netable/Netable.swift @@ -125,7 +125,14 @@ open class Netable { switch decoded { case .success(let raw): let finalizedData = request.finalize(raw: raw) - self.log(.requestSuccess(request: requestInfo, taskTime: time, statusCode: response.statusCode, responseData: data, finalizedResult: finalizedData)) + + switch finalizedData { + case .success(let finalizedResult): + self.log(.requestSuccess(request: requestInfo, taskTime: time, statusCode: response.statusCode, responseData: data, finalizedResult: finalizedResult)) + case .failure(let finalizedError): + throw finalizedError + } + completion(finalizedData) case .failure(let error): throw error