<?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 How to capture the error message in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-capture-the-error-message/m-p/323726#M19033</link>
    <description>&lt;P&gt;I want to capture the error message so I can do different actions depending on the text.&amp;nbsp; I can't figure out how to code this.&amp;nbsp; Here's my code...&lt;/P&gt;&lt;PRE&gt;        if DropboxClientsManager.authorizedClient != nil {
            print("We have an authorized client.  Now let's see if we can get the file attributes")
            
            // Check to see if Nvelopes.csv exists in Dropbox.
//            client!.files.getMetadata(path: "/Nvelopes.csv")
             client!.files.getMetadata(path: "/Nvelopes1.csv")
                .response {_ , error in
                    if let error = error {
                        print("We did not get the attributes :(")
                        print(error.description)
                        self.window?.rootViewController = mainStoryboard.instantiateViewController(withIdentifier: "sbLinkToDropbox") as UIViewController
                                            }
             }
            
        }&lt;/PRE&gt;&lt;P&gt;... and here's the result of print(error.description):&lt;/P&gt;&lt;PRE&gt;[request-id 7185a7cb73542868da1649971559a895] API route error - {
    ".tag" = path;
    path =     {
        ".tag" = "not_found";
    };
}&lt;/PRE&gt;&lt;P&gt;How do I capture the part after ".tag" =??&lt;/P&gt;&lt;P&gt;Thanks for your patience!&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:08:21 GMT</pubDate>
    <dc:creator>RJKinsman</dc:creator>
    <dc:date>2019-05-29T09:08:21Z</dc:date>
    <item>
      <title>How to capture the error message</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-capture-the-error-message/m-p/323726#M19033</link>
      <description>&lt;P&gt;I want to capture the error message so I can do different actions depending on the text.&amp;nbsp; I can't figure out how to code this.&amp;nbsp; Here's my code...&lt;/P&gt;&lt;PRE&gt;        if DropboxClientsManager.authorizedClient != nil {
            print("We have an authorized client.  Now let's see if we can get the file attributes")
            
            // Check to see if Nvelopes.csv exists in Dropbox.
//            client!.files.getMetadata(path: "/Nvelopes.csv")
             client!.files.getMetadata(path: "/Nvelopes1.csv")
                .response {_ , error in
                    if let error = error {
                        print("We did not get the attributes :(")
                        print(error.description)
                        self.window?.rootViewController = mainStoryboard.instantiateViewController(withIdentifier: "sbLinkToDropbox") as UIViewController
                                            }
             }
            
        }&lt;/PRE&gt;&lt;P&gt;... and here's the result of print(error.description):&lt;/P&gt;&lt;PRE&gt;[request-id 7185a7cb73542868da1649971559a895] API route error - {
    ".tag" = path;
    path =     {
        ".tag" = "not_found";
    };
}&lt;/PRE&gt;&lt;P&gt;How do I capture the part after ".tag" =??&lt;/P&gt;&lt;P&gt;Thanks for your patience!&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:08:21 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-capture-the-error-message/m-p/323726#M19033</guid>
      <dc:creator>RJKinsman</dc:creator>
      <dc:date>2019-05-29T09:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture the error message</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-capture-the-error-message/m-p/323738#M19034</link>
      <description>&lt;P&gt;There's an example of breaking down the error like this in the readme here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/dropbox/SwiftyDropbox#route-specific-errors" target="_blank"&gt;https://github.com/dropbox/SwiftyDropbox#route-specific-errors&lt;/A&gt;&lt;/P&gt;&lt;P&gt;That example is for the delete call, but the mechanic is the same. For &lt;A href="https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/FilesRoutes.html#/s:13SwiftyDropbox11FilesRoutesC11getMetadata4path16includeMediaInfo0H7Deleted0H24HasExplicitSharedMembers0H14PropertyGroupsAA10RpcRequestCyAA0C0C0F10SerializerCAM03Getf5ErrorT0CGSS_S3bAA14FilePropertiesC18TemplateFilterBaseOSgtF" target="_self"&gt;getMetadata&lt;/A&gt;, the route-specific error type is &lt;A href="https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/Files/GetMetadataError.html" target="_self"&gt;GetMetadataError&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Be sure to check out the section right after that for an example of handling higher-level errors too.&lt;/P&gt;&lt;P&gt;You can make the error handling as broad or as specific as you wish by&amp;nbsp;breaking out each case (or not).&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 15:09:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-capture-the-error-message/m-p/323738#M19034</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-01-17T15:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture the error message</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-capture-the-error-message/m-p/323741#M19035</link>
      <description>&lt;P&gt;Thanks again, Greg&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 15:35:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-capture-the-error-message/m-p/323741#M19035</guid>
      <dc:creator>RJKinsman</dc:creator>
      <dc:date>2019-01-17T15:35:01Z</dc:date>
    </item>
  </channel>
</rss>

