reddit/reddit — Issue #287: Subreddit JSON info inconsistent and nondescriptive.
Author: nemec
Created: 2011-12-15 20:25:34+00:00
State: open

We're using the url `http://www.reddit.com/r/[SUBREDDIT]/about/.json` to grab information about certain subreddits, but when it comes to invalid input for the subreddit name the response is vague and sometimes inconsistent.

If you try and request information from a nonexistent subreddit (eg. `http://www.reddit.com/r/nemec/about/.json`), you are sometimes redirected to the subreddit search feature (html) rather than given a JSON response indicating an invalid request.

For private subreddits (http://www.reddit.com/r/nemec_sandbox/about/.json), we rightfully receive the response `{error: 403}`, but it would be nice to have some additional information returned indicating the specific error like with POST requests, as we use an object hook to generate user-friendly exceptions off of your [error messages](https://github.com/reddit/reddit/blob/master/r2/r2/controllers/errors.py).

Similarly with [nonexistent](http://www.reddit.com/r/j/about/.json), [banned](http://www.reddit.com/r/InfiniteMods/about/.json), and [invalid](http://www.reddit.com/r/_df/about/.json) subreddits, a vague response of `{error: 404}` is generated.

I haven't done a whole lot of poking around into the code (beyond the standard API calls), but is it beyond the scope of the .json syntax to handle more complicated error scenarios?