Skip to content

Commit 5f5d6b5

Browse files
authored
Updated some samples in README.md
1 parent a49c91f commit 5f5d6b5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -544,12 +544,12 @@ To properly handle union types, you should pass each union through a switch stat
544544

545545
#### Route-specific errors
546546
```Swift
547-
client.files.delete(path: "/test/path/in/Dropbox/account").response { response, error in
547+
client.files.deleteV2(path: "/test/path/in/Dropbox/account").response { response, error in
548548
if let response = response {
549549
print(response)
550550
} else if let error = error {
551551
switch error as CallError {
552-
case .routeError(let boxed, let requestId):
552+
case .routeError(let boxed, let userMessage, let errorSummary, let requestId):
553553
print("RouteError[\(requestId)]:")
554554

555555
switch boxed.unboxed as Files.DeleteError {
@@ -571,6 +571,10 @@ client.files.delete(path: "/test/path/in/Dropbox/account").response { response,
571571
case .pathWrite(let writeError):
572572
print("WriteError: \(writeError)")
573573
// you can handle each `WriteError` case like the `DeleteError` cases above
574+
case .tooManyWriteOperations:
575+
print("Another write operation occurring at the same time prevented this from succeeding.")
576+
case .tooManyFiles:
577+
print("There are too many files to delete.")
574578
case .other:
575579
print("Unknown")
576580
}
@@ -595,7 +599,7 @@ In the case of a network error, errors are either specific to the endpoint (as s
595599
To determine if an error is route-specific or not, the error object should be cast as a `CallError`, and depending on the type of error, handled in the appropriate switch statement.
596600

597601
```Swift
598-
client.files.delete(path: "/test/path/in/Dropbox/account").response { response, error in
602+
client.files.deleteV2(path: "/test/path/in/Dropbox/account").response { response, error in
599603
if let response = response {
600604
print(response)
601605
} else if let error = error {
@@ -638,7 +642,7 @@ For example, the [/delete](https://www.dropbox.com/developers/documentation/http
638642
To determine at runtime which subtype the `Metadata` type exists as, pass the object through a switch statement, and check for each possible class, with the result casted accordingly. See below:
639643

640644
```Swift
641-
client.files.delete(path: "/test/path/in/Dropbox/account").response { response, error in
645+
client.files.deleteV2(path: "/test/path/in/Dropbox/account").response { response, error in
642646
if let response = response {
643647
switch response {
644648
case let fileMetadata as Files.FileMetadata:
@@ -650,7 +654,7 @@ client.files.delete(path: "/test/path/in/Dropbox/account").response { response,
650654
}
651655
} else if let error = error {
652656
switch error as CallError {
653-
case .routeError(let boxed, let requestId):
657+
case .routeError(let boxed, let userMessage, let errorSummary, let requestId):
654658
// a route-specific error occurred
655659
// see handling above
656660
case .internalServerError(let code, let message, let requestId):

0 commit comments

Comments
 (0)