Skip to content

Commit 77729f4

Browse files
committed
Fix error dialog issue and update dependencies
1 parent 8005213 commit 77729f4

6 files changed

Lines changed: 29 additions & 16 deletions

File tree

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<dependency>
6565
<groupId>com.fasterxml.jackson.core</groupId>
6666
<artifactId>jackson-databind</artifactId>
67-
<version>2.20.0</version>
67+
<version>2.20.1</version>
6868
</dependency>
6969

7070
<!-- https://mvnrepository.com/artifact/ch.qos.logback/logback-classic -->
@@ -78,7 +78,7 @@
7878
<dependency>
7979
<groupId>org.junit.jupiter</groupId>
8080
<artifactId>junit-jupiter-api</artifactId>
81-
<version>6.0.0</version>
81+
<version>6.0.1</version>
8282
<scope>test</scope>
8383
</dependency>
8484

@@ -94,7 +94,7 @@
9494
<dependency>
9595
<groupId>com.formdev</groupId>
9696
<artifactId>flatlaf</artifactId>
97-
<version>3.6.1</version>
97+
<version>3.6.2</version>
9898
</dependency>
9999
</dependencies>
100100

@@ -106,7 +106,7 @@
106106
<!--https://mvnrepository.com/artifact/org.codehaus.mojo/exec-maven-plugin/3.5.1-->
107107
<groupId>org.codehaus.mojo</groupId>
108108
<artifactId>exec-maven-plugin</artifactId>
109-
<version>3.5.1</version> <!-- Use the latest version -->
109+
<version>3.6.2</version>
110110
<configuration>
111111
<mainClass>${project.mainClass}</mainClass>
112112
</configuration>
@@ -117,7 +117,7 @@
117117
<!--https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin/3.14.0-->
118118
<groupId>org.apache.maven.plugins</groupId>
119119
<artifactId>maven-compiler-plugin</artifactId>
120-
<version>3.14.0</version>
120+
<version>3.14.1</version>
121121
<configuration>
122122
<source>${maven.compiler.source}</source>
123123
<target>${maven.compiler.target}</target>

src/main/java/org/pwss/controller/HomeController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ public void performStartScan(boolean singleDirectory) {
679679
if (baseLineScan) {
680680
screen.showSuccess(StringConstants.SCAN_STARTED_BASELINE_SUCCESS);
681681
} else {
682-
screen.showSuccess(StringConstants.SCAN_STARTED_SUCCESS);
682+
log.info(StringConstants.SCAN_STARTED_SUCCESS);
683683
}
684684
startPollingScanLiveFeed(singleDirectory, scanningDirs);
685685
} else {

src/main/java/org/pwss/controller/LoginController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ private void performLogin() {
253253
if (createUserMode) {
254254
screen.showInfo("User created and logged in successfully!");
255255
} else {
256-
screen.showInfo("Logged in successfully!");
256+
log.info("Logged in successfully!");
257257
}
258258
AppConfig.setLicenseKey(licenseKey);
259259
NavigationEvents.navigateTo(Screen.HOME);

src/main/java/org/pwss/controller/ScanDetailsController.java

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,18 @@
1919
import org.pwss.utils.ReportUtils;
2020
import org.pwss.utils.StringConstants;
2121
import org.pwss.view.screen.ScanDetailsScreen;
22+
import org.slf4j.LoggerFactory;
2223

2324
/**
2425
* Controller class that handles operations related to the scan details screen.
2526
*/
2627
public class ScanDetailsController extends BaseController<ScanDetailsScreen> implements CellButtonListener {
2728

29+
/**
30+
* Logger for logging messages within this controller.
31+
*/
32+
private final org.slf4j.Logger log = LoggerFactory.getLogger(LoginController.class);
33+
2834
/**
2935
* Service responsible for managing scan summaries.
3036
*/
@@ -140,7 +146,8 @@ void refreshView() {
140146
screen.getDiffTable().setModel(diffTableModel);
141147

142148
screen.getDiffTable().getColumn(DiffTableModel.columns[3]).setCellRenderer(new ButtonRenderer());
143-
screen.getDiffTable().getColumn(DiffTableModel.columns[3]).setCellEditor(new ButtonEditor("\uD83D\uDCE5", this));
149+
screen.getDiffTable().getColumn(DiffTableModel.columns[3])
150+
.setCellEditor(new ButtonEditor("\uD83D\uDCE5", this));
144151
}
145152

146153
@Override
@@ -152,21 +159,28 @@ public void onCellButtonClicked(int row, int column) {
152159
int choice = screen.showOptionDialog(
153160
JOptionPane.WARNING_MESSAGE,
154161
OSUtils.getQuarantineWarningMessage(),
155-
new String[]{StringConstants.GENERIC_YES, StringConstants.GENERIC_NO},
156-
StringConstants.GENERIC_NO
157-
);
162+
new String[] { StringConstants.GENERIC_YES, StringConstants.GENERIC_NO },
163+
StringConstants.GENERIC_NO);
158164
if (choice == 0) {
159165
try {
160166
boolean success = fileService.quarantineFile(d.integrityFail().file().id());
161167
if (success) {
162-
screen.showInfo("File quarantined successfully.");
168+
log.info("File quarantined successfully.");
163169
screen.getDiffTable().getColumn(d).setCellRenderer(new ButtonRenderer());
164170
screen.getDiffTable().getColumn(d).setCellEditor(new ButtonEditor("🗿", this));
165171
} else {
166172
screen.showError("Failed to quarantine the file.");
167173
}
168-
} catch (Exception e) {
169-
screen.showError(e.getMessage());
174+
175+
}
176+
177+
catch (IllegalArgumentException iae) {
178+
log.debug("Illegal argument exception {}",iae);
179+
}
180+
181+
catch (Exception e) {
182+
log.debug("Exception thrown {} ", e);
183+
log.error("Error code 455 : {}",e.getMessage());
170184
}
171185
}
172186
});

src/main/java/org/pwss/service/ScanService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public List<Diff> getDiffs(long scanId, long limit, String sortField, boolean as
208208
case 200 -> List.of(objectMapper.readValue(response.body(), Diff[].class));
209209
case 401 ->
210210
throw new GetScanDiffsException("Failed to fetch scan diffs: User not authorized to perform this action.");
211-
case 500 -> throw new GetScanDiffsException("Failed to fetch scan diffs: Server error");
211+
case 500 -> throw new GetScanDiffsException("Failed to fetch scan diffs");
212212
default -> Collections.emptyList();
213213
};
214214
}

src/main/java/org/pwss/view/screen/LoginScreen.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.intellij.uiDesigner.core.GridConstraints;
44
import com.intellij.uiDesigner.core.GridLayoutManager;
5-
import com.intellij.uiDesigner.core.Spacer;
65
import java.awt.Dimension;
76
import java.awt.Font;
87
import java.awt.Insets;

0 commit comments

Comments
 (0)