forked from Archives/Athou_commafeed
return smaller error when trying to subscribe to an invalid feed
This commit is contained in:
@@ -272,8 +272,9 @@ public class FeedREST {
|
|||||||
try {
|
try {
|
||||||
info = fetchFeedInternal(req.getUrl());
|
info = fetchFeedInternal(req.getUrl());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Throwable cause = Throwables.getRootCause(e);
|
||||||
return Response.status(Status.INTERNAL_SERVER_ERROR)
|
return Response.status(Status.INTERNAL_SERVER_ERROR)
|
||||||
.entity(Throwables.getStackTraceAsString(Throwables.getRootCause(e)))
|
.entity(cause.getClass().getName() + ": " + cause.getMessage())
|
||||||
.type(MediaType.TEXT_PLAIN)
|
.type(MediaType.TEXT_PLAIN)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user