<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Download Error, how to extract info in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-Error-how-to-extract-info/m-p/175812#M6963</link>
    <description>&lt;P&gt;Hi David, here's an example of using files.download with every error case handled in Swift: (apologies for the poor formatting on the forum)&lt;/P&gt;
&lt;PRE&gt;Dropbox.authorizedClient!.files.download(path: path, destination: destination).response { response, error in&lt;BR /&gt; if let (metadata, url) = response {&lt;BR /&gt; print("*** Download file ***")&lt;BR /&gt; print("Downloaded file name: \(metadata.name)")&lt;BR /&gt; print("Downloaded file url: \(url)")&lt;BR /&gt; } else if let callError = error {&lt;BR /&gt; switch callError as CallError {&lt;BR /&gt; case .RouteError(let boxed, let requestId):&lt;BR /&gt; print("RouteError[\(requestId)]:")&lt;BR /&gt; switch boxed.unboxed as Files.DownloadError {&lt;BR /&gt; case .Path(let fileLookupError):&lt;BR /&gt; print("PathError: ")&lt;BR /&gt; switch fileLookupError {&lt;BR /&gt; case .MalformedPath(let malformedPathError):&lt;BR /&gt; print("MalformedPath: \(malformedPathError)")&lt;BR /&gt; case .NotFile:&lt;BR /&gt; print("NotFile")&lt;BR /&gt; case .NotFolder:&lt;BR /&gt; print("NotFolder")&lt;BR /&gt; case .NotFound:&lt;BR /&gt; print("NotFound")&lt;BR /&gt; case .RestrictedContent:&lt;BR /&gt; print("RestrictedContent")&lt;BR /&gt; case .Other:&lt;BR /&gt; print("Other")&lt;BR /&gt; }&lt;BR /&gt; case .Other:&lt;BR /&gt; print("Other")&lt;BR /&gt; }&lt;BR /&gt; case .BadInputError(let message, let requestId):&lt;BR /&gt; print("BadInputError[\(requestId)]: \(message)")&lt;BR /&gt; case .HTTPError(let code, let message, let requestId):&lt;BR /&gt; print("HTTPError[\(requestId)]: \(code): \(message)")&lt;BR /&gt; case .InternalServerError(let code, let message, let requestId):&lt;BR /&gt; print("InternalServerError[\(requestId)]: \(code): \(message)")&lt;BR /&gt; case .OSError(let err):&lt;BR /&gt; print("OSError: \(err)")&lt;BR /&gt; case .RateLimitError:&lt;BR /&gt; print("RateLimitError")&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; }&lt;BR /&gt;}&lt;/PRE&gt;
&lt;P&gt;If I understand your question correctly, you can do the specific error detection in your Swift code, and then send whatever indicator or information&amp;nbsp;you want back to the Objective-C side, as opposed to the error object or description itself.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jul 2016 00:08:30 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2016-07-13T00:08:30Z</dc:date>
    <item>
      <title>Download Error, how to extract info</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-Error-how-to-extract-info/m-p/175811#M6962</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am brand new to Swift, in fact only started looking at it in order to use swiftydropbox! Currently I don't see how to extract info from the downloadError without doing string finding jiggery pokkery!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am coming from objC class and sending a download with completion message to my swift wrapper class which contains&amp;nbsp;client.files.download()&lt;/P&gt;
&lt;P&gt;if there is no response I am doing this:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;completion(success: false, error: error?.description)&lt;/P&gt;
&lt;P&gt;however I am finding it tricky to use this error description back in my objC class. What is best way to simply get the error code out of this or the&amp;nbsp;NSUnderlyingError? I feel sure I don't need to go wading into that string and searching for key phrases?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and sorry for the noob question!&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:31:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-Error-how-to-extract-info/m-p/175811#M6962</guid>
      <dc:creator>David E.64</dc:creator>
      <dc:date>2019-05-29T09:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Download Error, how to extract info</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-Error-how-to-extract-info/m-p/175812#M6963</link>
      <description>&lt;P&gt;Hi David, here's an example of using files.download with every error case handled in Swift: (apologies for the poor formatting on the forum)&lt;/P&gt;
&lt;PRE&gt;Dropbox.authorizedClient!.files.download(path: path, destination: destination).response { response, error in&lt;BR /&gt; if let (metadata, url) = response {&lt;BR /&gt; print("*** Download file ***")&lt;BR /&gt; print("Downloaded file name: \(metadata.name)")&lt;BR /&gt; print("Downloaded file url: \(url)")&lt;BR /&gt; } else if let callError = error {&lt;BR /&gt; switch callError as CallError {&lt;BR /&gt; case .RouteError(let boxed, let requestId):&lt;BR /&gt; print("RouteError[\(requestId)]:")&lt;BR /&gt; switch boxed.unboxed as Files.DownloadError {&lt;BR /&gt; case .Path(let fileLookupError):&lt;BR /&gt; print("PathError: ")&lt;BR /&gt; switch fileLookupError {&lt;BR /&gt; case .MalformedPath(let malformedPathError):&lt;BR /&gt; print("MalformedPath: \(malformedPathError)")&lt;BR /&gt; case .NotFile:&lt;BR /&gt; print("NotFile")&lt;BR /&gt; case .NotFolder:&lt;BR /&gt; print("NotFolder")&lt;BR /&gt; case .NotFound:&lt;BR /&gt; print("NotFound")&lt;BR /&gt; case .RestrictedContent:&lt;BR /&gt; print("RestrictedContent")&lt;BR /&gt; case .Other:&lt;BR /&gt; print("Other")&lt;BR /&gt; }&lt;BR /&gt; case .Other:&lt;BR /&gt; print("Other")&lt;BR /&gt; }&lt;BR /&gt; case .BadInputError(let message, let requestId):&lt;BR /&gt; print("BadInputError[\(requestId)]: \(message)")&lt;BR /&gt; case .HTTPError(let code, let message, let requestId):&lt;BR /&gt; print("HTTPError[\(requestId)]: \(code): \(message)")&lt;BR /&gt; case .InternalServerError(let code, let message, let requestId):&lt;BR /&gt; print("InternalServerError[\(requestId)]: \(code): \(message)")&lt;BR /&gt; case .OSError(let err):&lt;BR /&gt; print("OSError: \(err)")&lt;BR /&gt; case .RateLimitError:&lt;BR /&gt; print("RateLimitError")&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; }&lt;BR /&gt;}&lt;/PRE&gt;
&lt;P&gt;If I understand your question correctly, you can do the specific error detection in your Swift code, and then send whatever indicator or information&amp;nbsp;you want back to the Objective-C side, as opposed to the error object or description itself.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 00:08:30 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-Error-how-to-extract-info/m-p/175812#M6963</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-07-13T00:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Download Error, how to extract info</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-Error-how-to-extract-info/m-p/175813#M6964</link>
      <description>&lt;P&gt;thanks Gregory, i'll give that a bash &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@994EEA5C10EE66675FFD5E4032FE58C0/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 17:40:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Download-Error-how-to-extract-info/m-p/175813#M6964</guid>
      <dc:creator>David E.64</dc:creator>
      <dc:date>2016-07-13T17:40:03Z</dc:date>
    </item>
  </channel>
</rss>

