<?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 V2 API - error message format in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/V2-API-error-message-format/m-p/205928#M9978</link>
    <description>&lt;P&gt;Objective C DBRoulette&amp;nbsp;&lt;SPAN&gt;PhotoViewController.m "&lt;/SPAN&gt;&lt;SPAN&gt;downloadImage".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Handling of&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DBFILESDownloadError creates message strings using "&lt;/SPAN&gt;&lt;SPAN&gt;routeError" without appending ".path", in contrast with that shown in "&lt;/SPAN&gt;&lt;SPAN&gt;randomPhotoButtonPressed". I realize that these are two different errors. However, the relevant header files say to test "isPath" before accessing such, and "&lt;/SPAN&gt;&lt;SPAN&gt;routeError" is an NSObject that has a "path" property. Why doesn't this append the ".path"? Is that a bug? Or is that somehow related to the statement about routeError being a union of some type?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:26:03 GMT</pubDate>
    <dc:creator>AppleGG</dc:creator>
    <dc:date>2019-05-29T09:26:03Z</dc:date>
    <item>
      <title>V2 API - error message format</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/V2-API-error-message-format/m-p/205928#M9978</link>
      <description>&lt;P&gt;Objective C DBRoulette&amp;nbsp;&lt;SPAN&gt;PhotoViewController.m "&lt;/SPAN&gt;&lt;SPAN&gt;downloadImage".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Handling of&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DBFILESDownloadError creates message strings using "&lt;/SPAN&gt;&lt;SPAN&gt;routeError" without appending ".path", in contrast with that shown in "&lt;/SPAN&gt;&lt;SPAN&gt;randomPhotoButtonPressed". I realize that these are two different errors. However, the relevant header files say to test "isPath" before accessing such, and "&lt;/SPAN&gt;&lt;SPAN&gt;routeError" is an NSObject that has a "path" property. Why doesn't this append the ".path"? Is that a bug? Or is that somehow related to the statement about routeError being a union of some type?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:26:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/V2-API-error-message-format/m-p/205928#M9978</guid>
      <dc:creator>AppleGG</dc:creator>
      <dc:date>2019-05-29T09:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: V2 API - error message format</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/V2-API-error-message-format/m-p/205934#M9980</link>
      <description>&lt;P&gt;For reference, that&amp;nbsp;second parameter to the response block for any given API call is referred to as a "route error", because it is specific to the route. (Whereas the &lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBRequestError.html" target="_self"&gt;DBRequestError&lt;/A&gt; is not specific to the route.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each of these errors are a "union" meaning any particular instance of them will be one of a set of values allowed for that type. There's more information in the &lt;A href="https://github.com/dropbox/dropbox-sdk-obj-c#handling-responses-and-errors" target="_self"&gt;"Handling responses and errors" section of the readme&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For listFolder, the route error is an instance of &lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESListFolderError.html" target="_self"&gt;DBFILESListFolderError&lt;/A&gt;. For the download calls, such as downloadData, the route error is an instance of &lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESDownloadError.html" target="_self"&gt;DBFILESDownloadError&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Those different types can&amp;nbsp;different properties.&amp;nbsp;You can drill in to the different ones using the relevant methods/fields. The "is" methods let you check the value of the union instance, while the fields, e.g., "path", let you get the actual value, as shown in the sample:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- &lt;A href="https://github.com/dropbox/dropbox-sdk-obj-c/blob/master/Examples/DBRoulette/CocoaPods/DBRoulette/DBRoulette/PhotoViewController.m#L46" target="_self"&gt;Calling isPath on&amp;nbsp;DBFILESListFolderError&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;- &lt;A href="https://github.com/dropbox/dropbox-sdk-obj-c/blob/master/Examples/DBRoulette/CocoaPods/DBRoulette/DBRoulette/PhotoViewController.m#L136" target="_self"&gt;Calling isPath on&amp;nbsp;DBFILESDownloadError&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There may be some overlap between any two, such as in this case where they happen to have the same properties.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Exactly how you handle the errors in your app is up to you. In the DBRoulette example, you're right that the listFolder error handling yields&amp;nbsp;the error's path value itself, while the downloadData error handling yields the error itself only. It would probably be better to give the path error there, like with listFolder, so I'll ask the team to update that. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 23:24:43 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/V2-API-error-message-format/m-p/205934#M9980</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-02-08T23:24:43Z</dc:date>
    </item>
  </channel>
</rss>

