Dropbox API Listing a folder Attempting to list a non-existant folder using the SwiftyDropbox library, as an example of error handling

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

// List folder
Dropbox.authorizedClient!.files.listFolder(path: "/nonexistantpath").response { response, error in
    print("*** List folder ***")
    if let result = response {
        print("Folder contents:")
        for entry in result.entries {
            print(entry.name)
        }
    } else if let callError = error {
        switch callError {
        case .RouteError(let boxed, _):
            switch boxed.unboxed {
            case .Path(let lookupError):
                print("lookupError:")
                print(lookupError)
            case .Other:
                print("Other")
            }
        default:
            print("default")
        }
    }
}


Got any Dropbox API Question?