通常,如果能够获得API为任何特定请求返回的所有可能错误的某种描述,那将是非常好的。这将使实现更加可靠,并将改善应用程序对用户的反馈。
想象一下,我们需要向用户显示本地化的错误消息,而不仅仅是"Request failed with error code xxx“。
这个错误{"error":"flattr_once","error_description":"You are not allowed to flattr this thing more than once this period","error_uri":"http:\/\/developers.flattr.net\/api"}就是一个很好的例子。文档中没有提到这一点,但应用程序需要理解这一点,并且可能不会让用户在将来选择flattr这一项。
发布于 2012-02-16 02:40:57
开发人员文档中有几个错误描述。例如当对许多资源通用的flattring failed和standard errors时的错误响应。
发布于 2012-01-31 22:33:23
这是我在讨好别人时发现的一些回应:
403 {"error":"flattr_once","error_description":"You are not allowed to flattr this thing more than once this period","error_uri":"http:\/\/developers.flattr.net\/api"}
401 {"error":"no_means","error_description":"You don't have any money to flattr with","error_uri":"http:\/\/developers.flattr.net\/api"}
{"error":"flattr_owner","error_description":"You are not allowed to flattr your own thing","error_uri":"http:\/\/developers.flattr.net\/api"}
https://stackoverflow.com/questions/8970325
复制相似问题