1919import org .pwss .utils .ReportUtils ;
2020import org .pwss .utils .StringConstants ;
2121import 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 */
2627public 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 });
0 commit comments