#1799 new defect

Document how to distinguish exceptions from JSON, or encode exceptions as JSON — at Version 1

Reported by: davidsarah Owned by:
Priority: normal Milestone: undecided
Component: code-frontend-web Version: 1.9.2
Keywords: json usability docs Cc: darrob
Launchpad Bug:

Description (last modified by davidsarah)

darrob: hello again. i have a python program that runs tahoe repair operations using urllib and parses tahoe's json responses. this works very well except for one thing: if a file is gone and i attempt a repair, the resulting NotEnoughSharesError? is not presented as json data but plaintext (a check without repair responds in json, however).

darrob: am i missing something on tahoe's side that i can do about it? if not, are there other error messages like this that i should be aware of before i adapt the program?

We need to document how to distinguish exceptions (I *think* valid JSON always starts with a "{" or "[" character).

An alternative would be to encode the exception as JSON (i.e. something like {"exception": "..."}), although that would make it more difficult to read. Since these APIs are mainly for programmatic use, that might be acceptible.

Change History (1)

comment:1 Changed at 2012-08-31T15:06:29Z by davidsarah

  • Description modified (diff)
Note: See TracTickets for help on using tickets.