From 6641bc0631751101834808baf7295f7a31605203 Mon Sep 17 00:00:00 2001 From: Athou Date: Mon, 10 Mar 2025 10:54:40 +0100 Subject: [PATCH] don't expose exception message --- .../com/commafeed/frontend/resource/FeedREST.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/commafeed-server/src/main/java/com/commafeed/frontend/resource/FeedREST.java b/commafeed-server/src/main/java/com/commafeed/frontend/resource/FeedREST.java index b44f756c..279c230c 100644 --- a/commafeed-server/src/main/java/com/commafeed/frontend/resource/FeedREST.java +++ b/commafeed-server/src/main/java/com/commafeed/frontend/resource/FeedREST.java @@ -77,6 +77,7 @@ import com.google.common.base.Throwables; import com.rometools.opml.feed.opml.Opml; import com.rometools.rome.feed.synd.SyndFeed; import com.rometools.rome.feed.synd.SyndFeedImpl; +import com.rometools.rome.io.FeedException; import com.rometools.rome.io.SyndFeedOutput; import com.rometools.rome.io.WireFeedOutput; @@ -508,16 +509,12 @@ public class FeedREST { @Transactional @Produces(MediaType.APPLICATION_XML) @Operation(summary = "OPML export", description = "Export an OPML file of the user's subscriptions") - public Response exportOpml() { + public Response exportOpml() throws FeedException { User user = authenticationContext.getCurrentUser(); Opml opml = opmlExporter.export(user); + WireFeedOutput output = new WireFeedOutput(); - String opmlString; - try { - opmlString = output.outputString(opml); - } catch (Exception e) { - return Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); - } + String opmlString = output.outputString(opml); return Response.ok(opmlString).build(); }