{"id":7586,"date":"2013-07-13T15:13:31","date_gmt":"2013-07-13T20:13:31","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=7586"},"modified":"2014-04-15T20:26:16","modified_gmt":"2014-04-16T00:26:16","slug":"dberror","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2013\/07\/13\/dberror\/","title":{"rendered":"DBError"},"content":{"rendered":"<p>Apropos of the <a href=\"http:\/\/mjtsai.com\/blog\/2013\/07\/09\/dropbox-chooser-saver-and-datastore\/\">new Dropbox Datastore API<\/a>, <a href=\"https:\/\/gist.github.com\/schwa\/5967455\">Jonathan Wight<\/a> comments on how the SDK bizarrely makes a new class, <code>DBError<\/code>, that <a href=\"https:\/\/twitter.com\/schwa\/status\/354841370659262465\">subclasses<\/a> <code>NSError<\/code> to change the return type of the existing <code>-code<\/code> method, but doesn&rsquo;t add any functionality. Exposing a separate error class makes all sorts of code much more complicated. And then there&rsquo;s the issue of <a href=\"https:\/\/twitter.com\/schwa\/status\/354838964907147266\">some methods<\/a> <a href=\"https:\/\/twitter.com\/schwa\/status\/354836168275283968\">taking<\/a> <code>DBError *<\/code> for what is supposed to be an output parameter (<code>DBError **<\/code>). It&rsquo;s API <a href=\"https:\/\/twitter.com\/schwa\/status\/354836591430221826\">amateur hour<\/a>.<\/p>\r\n<p>Update (2013-07-13): Some of this is apparently <a href=\"https:\/\/twitter.com\/atomicbird\/status\/355791530444853249\">fixed already<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Apropos of the new Dropbox Datastore API, Jonathan Wight comments on how the SDK bizarrely makes a new class, DBError, that subclasses NSError to change the return type of the existing -code method, but doesn&rsquo;t add any functionality. Exposing a separate error class makes all sorts of code much more complicated. And then there&rsquo;s the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[47,857,54,71],"class_list":["post-7586","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-dropbox","tag-nserror","tag-objective-c","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=7586"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7586\/revisions"}],"predecessor-version":[{"id":8699,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7586\/revisions\/8699"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=7586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=7586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=7586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}