cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SwiftyDropbox Error Handling

SwiftyDropbox Error Handling

Jonathan Z.3
New member | Level 1

Hello!

I’ve been working with SwiftyDropbox and I’m having a curious problem with errors. Specifically, I’m not sure how to manipulate errors in the closure callbacks provided after responses are received.

For instance, the completion handler for Dropbox.authorizedClient.filesListFolder provides a CallError<(Files.ListFolderError)>? to work with. How would I go about checking if it is a CallError.HTTPError, so that I can get the HTTP error code out of it? Right now I’m just sucking that information out of the error’s .description but that doesn’t seem like the right way to do it.

Halp? 😞

I suspect that I do not properly understand how to deal with the generics involved:

 

2 Replies 2

Steve M.
Dropbox Staff

Jonathan Z.3
New member | Level 1

Ah, I should have cross-linked when I posted both. Thank you!

That SO answer was quite a gem.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Jonathan Z.3 New member | Level 1
  • User avatar
    Steve M. Dropbox Staff
What do Dropbox user levels mean?