File tree Expand file tree Collapse file tree 4 files changed +13
-6
lines changed
Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 11github "NeoTeo/SwiftMultiaddr"
2+ #git "file:///Users/teo/source/Apple/macOS/Libraries/SwiftMultiaddr" "test"
Original file line number Diff line number Diff line change 402402 GCC_WARN_UNUSED_VARIABLE = YES;
403403 IPHONEOS_DEPLOYMENT_TARGET = 8.0;
404404 LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks";
405- MACOSX_DEPLOYMENT_TARGET = 10.11 ;
405+ MACOSX_DEPLOYMENT_TARGET = 10.13 ;
406406 MTL_ENABLE_DEBUG_INFO = YES;
407407 ONLY_ACTIVE_ARCH = YES;
408408 SDKROOT = macosx;
471471 GCC_WARN_UNUSED_VARIABLE = YES;
472472 IPHONEOS_DEPLOYMENT_TARGET = 8.0;
473473 LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks";
474- MACOSX_DEPLOYMENT_TARGET = 10.11 ;
474+ MACOSX_DEPLOYMENT_TARGET = 10.13 ;
475475 MTL_ENABLE_DEBUG_INFO = NO;
476476 SDKROOT = macosx;
477477 SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos";
Original file line number Diff line number Diff line change @@ -154,11 +154,14 @@ extension Multipart {
154154 let task = URLSession . shared. dataTask ( with: ( multipart. request as URLRequest ) ) {
155155 ( data: Data ? , response: URLResponse ? , error: Error ? ) -> Void in
156156
157- guard error == nil && data != nil else {
158- print ( " Error in dataTaskWithRequest: \( String ( describing: error) ) " ) //throw HttpIoError.TransmissionError("fail: \(error)")
157+ // FIXME: use Swift 5 Result type rather than passing nil data.
158+ if error != nil || data == nil {
159+ print ( " Error in dataTaskWithRequest: \( String ( describing: error) ) " )
160+ let emptyData = Data ( )
161+ completionHandler ( emptyData)
159162 return
160163 }
161-
164+
162165 completionHandler ( data!)
163166
164167 }
Original file line number Diff line number Diff line change @@ -60,7 +60,10 @@ class SwiftIpfsApiTests: XCTestCase {
6060 try api. refs. local ( ) { ( localRefs: [ Multihash ] ) in
6161
6262 for mh in localRefs {
63- print ( b58String ( mh) )
63+ // Bad assumption that the string is necessarily in base 58.
64+ // Check first.
65+ print ( " multihash string : \( mh. string ( ) ) " )
66+ // print(b58String(mh))
6467 }
6568
6669 expectation. fulfill ( )
You can’t perform that action at this time.
0 commit comments