logging and try catch

This commit is contained in:
Anthony Stirling
2024-06-02 11:59:43 +01:00
parent c4a620e3f5
commit eb526a5d0c
21 changed files with 125 additions and 71 deletions

View File

@@ -6,6 +6,8 @@ import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
@@ -26,6 +28,8 @@ import stirling.software.SPDF.model.Dependency;
@Controller
public class HomeWebController {
private static final Logger logger = LoggerFactory.getLogger(HomeWebController.class);
@GetMapping("/about")
@Hidden
public String gameForm(Model model) {
@@ -46,7 +50,7 @@ public class HomeWebController {
mapper.readValue(json, new TypeReference<Map<String, List<Dependency>>>() {});
model.addAttribute("dependencies", data.get("dependencies"));
} catch (IOException e) {
e.printStackTrace();
logger.error("exception", e);
}
return "licenses";
}