Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
micnori committed Mar 27, 2024
1 parent c574841 commit 567a6b3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import it.smartcommunitylabdhub.core.repositories.ArtifactRepository;
import it.smartcommunitylabdhub.core.repositories.DataItemRepository;
import it.smartcommunitylabdhub.core.repositories.FunctionRepository;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -34,6 +36,7 @@
@RestController
@RequestMapping("/solr")
@ApiVersion("v1")
@Slf4j
@PreAuthorize("hasAuthority('ROLE_ADMIN')")
public class SolrController {

Expand Down Expand Up @@ -161,6 +164,7 @@ public ResponseEntity<SolrPage<SearchGroupResult>> searchGroup(
SolrPage<SearchGroupResult> page = solrComponent.groupSearch(q, fq, pageRequest);
return ResponseEntity.ok(page);
} catch (Exception e) {
SolrController.log.error(String.format("searchGroup:", e.getMessage()));
return ResponseEntity.ok(null);
}
}
Expand All @@ -176,6 +180,7 @@ public ResponseEntity<SolrPage<ItemResult>> search(
SolrPage<ItemResult> page = solrComponent.itemSearch(q, fq, pageRequest);
return ResponseEntity.ok(page);
} catch (Exception e) {
SolrController.log.error(String.format("search:", e.getMessage()));
return ResponseEntity.ok(null);
}
}
Expand Down

0 comments on commit 567a6b3

Please sign in to comment.