File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44The format is based on [ Keep a Changelog] ( http://keepachangelog.com/en/1.0.0/ )
55and this project adheres to [ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) .
66
7+ ## [ 0.8.2] - 2020-03-02
8+ ### Added
9+ - Added missing error codes
10+
711## [ 0.8.1] - 2020-02-11
812### Changed
913- Lowered minimum iOS target to 11
Original file line number Diff line number Diff line change 11Pod ::Spec . new do |s |
22 s . name = 'Netable'
3- s . version = '0.8.1 '
3+ s . version = '0.8.2 '
44 s . summary = 'A simple and swifty networking library.'
55 s . description = 'Netable is a simple Swift framework for working with both simple and non-REST-compliant HTTP endpoints.'
66 s . homepage = 'https://github.com/steamclock/netable/'
77 s . license = { :type => 'MIT' , :file => 'LICENSE' }
88 s . author = { 'Brendan Lensink' => 'brendan@steamclock.com' }
9- s . source = { :git => 'https://github.com/steamclock/netable.git' , :tag => 'v0.8.1 ' }
9+ s . source = { :git => 'https://github.com/steamclock/netable.git' , :tag => 'v0.8.2 ' }
1010 s . ios . deployment_target = '11.0'
1111 s . osx . deployment_target = '10.14'
1212 s . source_files = 'Netable/Netable/*.{swift,h,m}'
Original file line number Diff line number Diff line change 586586 "@executable_path/Frameworks",
587587 "@loader_path/Frameworks",
588588 );
589- MARKETING_VERSION = 0.8.1 ;
589+ MARKETING_VERSION = 0.8.2 ;
590590 PRODUCT_BUNDLE_IDENTIFIER = com.steamclock.Netable;
591591 PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
592592 SKIP_INSTALL = YES;
616616 "@executable_path/Frameworks",
617617 "@loader_path/Frameworks",
618618 );
619- MARKETING_VERSION = 0.8.1 ;
619+ MARKETING_VERSION = 0.8.2 ;
620620 PRODUCT_BUNDLE_IDENTIFIER = com.steamclock.Netable;
621621 PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
622622 SKIP_INSTALL = YES;
Original file line number Diff line number Diff line change @@ -21,6 +21,29 @@ public enum NetableError: Error {
2121}
2222
2323extension NetableError : LocalizedError {
24+ public var errorCode : Int ? {
25+ switch self {
26+ case . codingError:
27+ return 0
28+ case . decodingError:
29+ return 1
30+ case . httpError( let statusCode, _) :
31+ return statusCode < 100 ? 2 : statusCode
32+ case . malformedURL:
33+ return 3
34+ case . requestFailed:
35+ return 4
36+ case . wrongServer:
37+ return 5
38+ case . noData:
39+ return 6
40+ case . resourceExtractionError:
41+ return 7
42+ case . unknownError:
43+ return 8
44+ }
45+ }
46+
2447 public var errorDescription : String ? {
2548 switch self {
2649 case . codingError( let message) :
You can’t perform that action at this time.
0 commit comments