diff --git a/src/main/java/auctiora/DatabaseService.java b/src/main/java/auctiora/DatabaseService.java index 8f056d6..646da3e 100644 --- a/src/main/java/auctiora/DatabaseService.java +++ b/src/main/java/auctiora/DatabaseService.java @@ -481,6 +481,9 @@ public class DatabaseService { } else { log.debug("Updated existing auction by URL: {}", auction.url()); } + } catch (SQLException updateEx) { + // UPDATE also failed - log and swallow the exception + log.warn("Failed to update auction by URL ({}): {}", auction.url(), updateEx.getMessage()); } } else { throw e; @@ -844,8 +847,12 @@ public class DatabaseService { } upsertAuction(auction); imported.add(auction); + } catch (SQLException e) { + // SQLException should be handled by upsertAuction, but if it propagates here, log it + log.warn("Failed to import auction (SQL error): {}", e.getMessage()); } catch (Exception e) { - System.err.println("Failed to import auction: " + e.getMessage()); + // Other exceptions (parsing errors, etc) + log.warn("Failed to import auction (parsing error): {}", e.getMessage()); } } } catch (SQLException e) {