Dropbox API Downloading a file Downloading a file with every error case handled using the SwiftyDropbox library

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 Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Dropbox.authorizedClient!.files.download(path: path, destination: destination).response { response, error in
    if let (metadata, url) = response {
        print("*** Download file ***")
        print("Downloaded file name: \(metadata.name)")
        print("Downloaded file url: \(url)")
    } else if let callError = error {
        switch callError as CallError {
            case .RouteError(let boxed, let requestId):
                print("RouteError[\(requestId)]:")
                switch boxed.unboxed as Files.DownloadError {
                case .Path(let fileLookupError):
                    print("PathError: ")
                    switch fileLookupError {
                    case .MalformedPath(let malformedPathError):
                        print("MalformedPath: \(malformedPathError)")
                    case .NotFile:
                        print("NotFile")
                    case .NotFolder:
                        print("NotFolder")
                    case .NotFound:
                        print("NotFound")
                    case .RestrictedContent:
                        print("RestrictedContent")
                    case .Other:
                        print("Other")
                    }
                case .Other:
                    print("Other")
            }
            case .BadInputError(let message, let requestId):
                print("BadInputError[\(requestId)]: \(message)")
            case .HTTPError(let code, let message, let requestId):
                print("HTTPError[\(requestId)]: \(code): \(message)")
            case .InternalServerError(let code, let message, let requestId):
                print("InternalServerError[\(requestId)]: \(code): \(message)")
            case .OSError(let err):
                print("OSError: \(err)")
            case .RateLimitError:
                print("RateLimitError")
            }
            
    }
}


Got any Dropbox API Question?