return smaller error when trying to subscribe to an invalid feed

This commit is contained in:
Athou
2022-08-13 18:05:24 +02:00
parent 5cb09bc4c6
commit 6c6cc8d85b

View File

@@ -272,8 +272,9 @@ public class FeedREST {
try {
info = fetchFeedInternal(req.getUrl());
} catch (Exception e) {
Throwable cause = Throwables.getRootCause(e);
return Response.status(Status.INTERNAL_SERVER_ERROR)
.entity(Throwables.getStackTraceAsString(Throwables.getRootCause(e)))
.entity(cause.getClass().getName() + ": " + cause.getMessage())
.type(MediaType.TEXT_PLAIN)
.build();
}