<?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: SwiftyDropbox, routeError not being generated in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-routeError-not-being-generated/m-p/248436#M14254</link>
    <description>&lt;P&gt;It looks like the issue is just how you're&amp;nbsp;checking&amp;nbsp;the .routeError case. Instead of this:&lt;/P&gt;
&lt;PRE&gt;case .routeError(let boxed, let requestId, nil, nil):&lt;/PRE&gt;
&lt;P&gt;do this:&lt;/P&gt;
&lt;PRE&gt;case .routeError(let boxed, _, _, let requestId):&lt;/PRE&gt;
&lt;P&gt;or more completely:&lt;/P&gt;
&lt;PRE&gt;case .routeError(let boxed, let userMessage, let errorSummary, let requestId):&lt;/PRE&gt;</description>
    <pubDate>Sat, 21 Oct 2017 13:27:48 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2017-10-21T13:27:48Z</dc:date>
    <item>
      <title>SwiftyDropbox, routeError not being generated</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-routeError-not-being-generated/m-p/248363#M14251</link>
      <description>&lt;P&gt;I'm just getting started with SwiftyDropbox, and am trying to get a better handle on Error Handling. I'm making a call to the /list_folder route, using dbClient.files.listFolder. If I put in a valid value for path, it all works great, but in order to test out the error hanlding I put invalid path (i.e. a path that doesn't exist.). From what I can tell from the Dropbox documentation, this should give a ListFolderError of type path LookupError.&lt;BR /&gt;&lt;BR /&gt;Below is the code I am using (which is based on the examples in the SwiftyDropbox documentation):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;dbClient.files.listFolder(path: "/Does not exist",
                              recursive: false,
                              includeMediaInfo: false,
                              includeDeleted: false,
                              includeHasExplicitSharedMembers: false,
                              includeMountedFolders: false,
                              limit: 15,
                              sharedLink: nil).response {response, error in
  if let response = response  {
    log.info("Dropbox Response:\n\(response)")
  } else if let error = error {
    log.error("Dropbox Error:\n\(error)")
    switch error as CallError {
      case .routeError(let boxed, let requestId, nil, nil):
        log.error("Route Error[\(requestId!)]")
        switch boxed.unboxed as Files.ListFolderError {
          case .path(let lookupError):
            log.error("Path Error: \(lookupError)")
            switch lookupError as Files.LookupError {
              case .malformedPath:
                log.error("Lookup Error: Malformed Path")
              case .notFound:
                log.error("Lookup Error: Not Found")
              case .notFile:
                log.error("Lookup Error: Not File")
              case .notFolder:
                log.error("Lookup Error: Not Folder")
              case .restrictedContent:
                log.error("Lookup Error: Restricted Content")
              default:
                log.error("Lookup Error: Non-specified")
            }
          case .other:
            log.error("Other Route Error")
        }
      case .clientError(let error):
        log.error("Client Error: \(error!)")
      case .badInputError(let message, let requestId):
        log.error("Bad input Error[\(requestId!)]: \(message!)")
      default:
        log.error("Other (Non-Route) Error")
    }
  }
}&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The raw error that is output is as follows:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dropbox Error:&lt;BR /&gt;[request-id 646c705e64c2cc76bd1b81925e5ea811] API route error - {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ".tag" = path;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; path =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ".tag" = "not_found";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;This seems right, so I would expect the error to be in the .routeError case, then .path case, and then in the .notFound case, and the output would be: "Lookup Error: Not Found"&lt;BR /&gt;&lt;BR /&gt;but instead I get the following output: "Other (Non-Route) Error"&lt;BR /&gt;&lt;BR /&gt;From the raw Dropbox error, it does look like I am getting the expected "path not_found" error, but for some reason it falls through into the "Non-Route" error case.&lt;BR /&gt;&lt;BR /&gt;Am I doing something wrong, or am I misunderstanding how this should work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:17:59 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-routeError-not-being-generated/m-p/248363#M14251</guid>
      <dc:creator>vewert</dc:creator>
      <dc:date>2019-05-29T09:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: SwiftyDropbox, routeError not being generated</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-routeError-not-being-generated/m-p/248436#M14254</link>
      <description>&lt;P&gt;It looks like the issue is just how you're&amp;nbsp;checking&amp;nbsp;the .routeError case. Instead of this:&lt;/P&gt;
&lt;PRE&gt;case .routeError(let boxed, let requestId, nil, nil):&lt;/PRE&gt;
&lt;P&gt;do this:&lt;/P&gt;
&lt;PRE&gt;case .routeError(let boxed, _, _, let requestId):&lt;/PRE&gt;
&lt;P&gt;or more completely:&lt;/P&gt;
&lt;PRE&gt;case .routeError(let boxed, let userMessage, let errorSummary, let requestId):&lt;/PRE&gt;</description>
      <pubDate>Sat, 21 Oct 2017 13:27:48 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-routeError-not-being-generated/m-p/248436#M14254</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-10-21T13:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: SwiftyDropbox, routeError not being generated</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-routeError-not-being-generated/m-p/248502#M14264</link>
      <description>&lt;P&gt;Yes, that was the problem, thanks! I'm pretty new to this type of construct, with these switch cases that have parameters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was trying to find the documentation for CallError and .routeError but couldn't find it, and am still a little unclear about whole "boxed" thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2017 18:10:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-routeError-not-being-generated/m-p/248502#M14264</guid>
      <dc:creator>vewert</dc:creator>
      <dc:date>2017-10-21T18:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: SwiftyDropbox, routeError not being generated</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-routeError-not-being-generated/m-p/248633#M14275</link>
      <description>Thanks! I'll ask the team to improve the documentation around this.</description>
      <pubDate>Sun, 22 Oct 2017 14:35:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-routeError-not-being-generated/m-p/248633#M14275</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-10-22T14:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: SwiftyDropbox, routeError not being generated</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-routeError-not-being-generated/m-p/248677#M14279</link>
      <description>That's great! I really appreciate the quick response.</description>
      <pubDate>Sun, 22 Oct 2017 20:39:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-routeError-not-being-generated/m-p/248677#M14279</guid>
      <dc:creator>vewert</dc:creator>
      <dc:date>2017-10-22T20:39:16Z</dc:date>
    </item>
  </channel>
</rss>

