Compare commits
2 Commits
4de4f7a0e9
...
b1565cf440
Author | SHA1 | Date | |
---|---|---|---|
b1565cf440 | |||
3b1f5c2ad9 |
@ -1,5 +1,6 @@
|
|||||||
package sh.adb.RandomRedditMemesAPI;
|
package sh.adb.RandomRedditMemesAPI;
|
||||||
|
|
||||||
|
import com.github.jreddit.oauth.exception.RedditOAuthException;
|
||||||
import com.github.jreddit.parser.entity.Submission;
|
import com.github.jreddit.parser.entity.Submission;
|
||||||
import com.github.jreddit.parser.exception.RedditParseException;
|
import com.github.jreddit.parser.exception.RedditParseException;
|
||||||
import com.sun.net.httpserver.Headers;
|
import com.sun.net.httpserver.Headers;
|
||||||
@ -62,7 +63,7 @@ class CommunityHandler implements HttpHandler {
|
|||||||
List<Submission> submissions = null;
|
List<Submission> submissions = null;
|
||||||
try {
|
try {
|
||||||
submissions = this.api.getSub(pathArray[4]);
|
submissions = this.api.getSub(pathArray[4]);
|
||||||
} catch (RedditParseException e) {
|
} catch (RedditParseException | RedditOAuthException e) {
|
||||||
responseJSON.put("error", "invalid subreddit");
|
responseJSON.put("error", "invalid subreddit");
|
||||||
sendResponse(t, responseJSON.toString());
|
sendResponse(t, responseJSON.toString());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
Loading…
Reference in New Issue
Block a user