File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies:
33
33
34
34
``` swift
35
35
dependencies: [
36
- .
package (
url :
" [email protected] :appwrite/sdk-for-swift.git" ,
from :
" 4.0.0 " ),
36
+ .
package (
url :
" [email protected] :appwrite/sdk-for-swift.git" ,
from :
" 4.0.1 " ),
37
37
],
38
38
```
39
39
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ open class Client {
23
23
" x-sdk-name " : " Swift " ,
24
24
" x-sdk-platform " : " server " ,
25
25
" x-sdk-language " : " swift " ,
26
- " x-sdk-version " : " 4.0.0 " ,
26
+ " x-sdk-version " : " 4.0.1 " ,
27
27
" X-Appwrite-Response-Format " : " 1.4.0 "
28
28
]
29
29
@@ -336,18 +336,21 @@ open class Client {
336
336
default :
337
337
var message = " "
338
338
var data = try await response. body. collect ( upTo: Int . max)
339
+ var type = " "
339
340
340
341
do {
341
342
let dict = try JSONSerialization . jsonObject ( with: data) as? [ String : Any ]
342
343
343
344
message = dict ? [ " message " ] as? String ?? response. status. reasonPhrase
345
+ type = dict ? [ " type " ] as? String ?? " "
344
346
} catch {
345
347
message = data. readString ( length: data. readableBytes) !
346
348
}
347
349
348
350
throw AppwriteError (
349
351
message: message,
350
- code: Int ( response. status. code)
352
+ code: Int ( response. status. code) ,
353
+ type: type
351
354
)
352
355
}
353
356
}
You can’t perform that action at this time.
0 commit comments