forked from Archives/Athou_commafeed
don't expose exception message
This commit is contained in:
@@ -77,6 +77,7 @@ import com.google.common.base.Throwables;
|
|||||||
import com.rometools.opml.feed.opml.Opml;
|
import com.rometools.opml.feed.opml.Opml;
|
||||||
import com.rometools.rome.feed.synd.SyndFeed;
|
import com.rometools.rome.feed.synd.SyndFeed;
|
||||||
import com.rometools.rome.feed.synd.SyndFeedImpl;
|
import com.rometools.rome.feed.synd.SyndFeedImpl;
|
||||||
|
import com.rometools.rome.io.FeedException;
|
||||||
import com.rometools.rome.io.SyndFeedOutput;
|
import com.rometools.rome.io.SyndFeedOutput;
|
||||||
import com.rometools.rome.io.WireFeedOutput;
|
import com.rometools.rome.io.WireFeedOutput;
|
||||||
|
|
||||||
@@ -508,16 +509,12 @@ public class FeedREST {
|
|||||||
@Transactional
|
@Transactional
|
||||||
@Produces(MediaType.APPLICATION_XML)
|
@Produces(MediaType.APPLICATION_XML)
|
||||||
@Operation(summary = "OPML export", description = "Export an OPML file of the user's subscriptions")
|
@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();
|
User user = authenticationContext.getCurrentUser();
|
||||||
Opml opml = opmlExporter.export(user);
|
Opml opml = opmlExporter.export(user);
|
||||||
|
|
||||||
WireFeedOutput output = new WireFeedOutput();
|
WireFeedOutput output = new WireFeedOutput();
|
||||||
String opmlString;
|
String opmlString = output.outputString(opml);
|
||||||
try {
|
|
||||||
opmlString = output.outputString(opml);
|
|
||||||
} catch (Exception e) {
|
|
||||||
return Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build();
|
|
||||||
}
|
|
||||||
return Response.ok(opmlString).build();
|
return Response.ok(opmlString).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user