|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package sh.adb.RandomRedditMemesAPI;
|
|
|
|
|
|
|
|
|
|
import com.github.jreddit.oauth.exception.RedditOAuthException;
|
|
|
|
|
import com.github.jreddit.parser.entity.Submission;
|
|
|
|
|
import com.github.jreddit.parser.exception.RedditParseException;
|
|
|
|
|
import com.sun.net.httpserver.Headers;
|
|
|
|
@ -62,7 +63,7 @@ class CommunityHandler implements HttpHandler {
|
|
|
|
|
List<Submission> submissions = null;
|
|
|
|
|
try {
|
|
|
|
|
submissions = this.api.getSub(pathArray[4]);
|
|
|
|
|
} catch (RedditParseException e) {
|
|
|
|
|
} catch (RedditParseException | RedditOAuthException e) {
|
|
|
|
|
responseJSON.put("error", "invalid subreddit");
|
|
|
|
|
sendResponse(t, responseJSON.toString());
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|