Objective C DBRoulette PhotoViewController.m "downloadImage".
Handling of DBFILESDownloadError creates message strings using "routeError" without appending ".path", in contrast with that shown in "randomPhotoButtonPressed". I realize that these are two different errors. However, the relevant header files say to test "isPath" before accessing such, and "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?
For reference, that 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 DBRequestError is not specific to the route.)
Those different types can different properties. 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:
There may be some overlap between any two, such as in this case where they happen to have the same properties.
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 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!
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?