forked from Archives/Athou_commafeed
Make subscription failures visible.
--HG-- extra : rebase_source : 9e7232b821665d9a6342c928d0b17ac3bdd9e6e7
This commit is contained in:
@@ -224,9 +224,15 @@ public class FeedREST extends AbstractResourceREST {
|
||||
FeedCategory category = CategoryREST.ALL.equals(req.getCategoryId()) ? null
|
||||
: feedCategoryDAO.findById(Long.valueOf(req.getCategoryId()));
|
||||
FeedInfo info = (FeedInfo) fetchFeed(url).getEntity();
|
||||
feedSubscriptionService.subscribe(getUser(), info.getUrl(),
|
||||
try {
|
||||
feedSubscriptionService.subscribe(getUser(), info.getUrl(),
|
||||
req.getTitle(), category);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.info("Failed to subscribe to URL {}: {}", url, e.getMessage());
|
||||
return Response.status(Status.SERVICE_UNAVAILABLE).entity(
|
||||
"Failed to subscribe to URL " + url + ": " + e.getMessage()
|
||||
).build();
|
||||
}
|
||||
return Response.ok(Status.OK).build();
|
||||
}
|
||||
|
||||
|
||||
@@ -75,8 +75,11 @@ function($scope, FeedService, CategoryService) {
|
||||
}
|
||||
FeedService.subscribe($scope.sub, function() {
|
||||
CategoryService.init();
|
||||
$scope.close();
|
||||
}, function(data) {
|
||||
$scope.state = 'failed';
|
||||
$scope.sub.title = 'ERROR: ' + data.data;
|
||||
});
|
||||
$scope.close();
|
||||
};
|
||||
|
||||
$scope.openImport = function() {
|
||||
|
||||
Reference in New Issue
Block a user