Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions Netable.podspec
Original file line number Diff line number Diff line change
@@ -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}'
Expand Down
4 changes: 2 additions & 2 deletions Netable/Netable.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Netable/Netable/LogDestination.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 8 additions & 1 deletion Netable/Netable/Netable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down