Commit 9b0dade9e1730db715aec7f502fe894d819c154b

Authored by Nathanael Jourdane
1 parent 45805103
Exists in master

Improve error displaying.

src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapController.java
... ... @@ -64,12 +64,12 @@ public class EpnTapController {
64 64 try {
65 65 servicesCtrl.readTable();
66 66 } catch (CantGetVOTableException e) {
67   - displayError(e);
  67 + displayError("Can not get services.", e);
68 68 }
69 69 }
70 70  
71   - public void displayError(Exception e) {
72   - logger.log(Level.SEVERE, "Can not get services.", e);
  71 + public void displayError(String message, Exception e) {
  72 + logger.log(Level.SEVERE, message, e);
73 73 }
74 74  
75 75 public String sendQuery(String query, String tableServiceURL)
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/gui/GUIController.java
... ... @@ -58,7 +58,7 @@ public class GUIController extends EpnTapController implements ViewListener {
58 58 try {
59 59 servicesCtrl.readTable();
60 60 } catch (CantGetVOTableException e) {
61   - displayError(e);
  61 + displayError("Can not get services.", e);
62 62 }
63 63 mainView.getServicesPanel().fillTable(servicesCtrl.getVOTableData());
64 64 }
... ... @@ -82,16 +82,17 @@ public class GUIController extends EpnTapController implements ViewListener {
82 82 try {
83 83 voTablePath = sendQuery(query, selectedTableServiceURL);
84 84 } catch (CantGetVOTableException e) {
85   - // TODO create exception
86   - mainView.displayError("Can not send query.", e.getMessage());
  85 + displayError("Can not send the query.", e);
87 86 GUIController.logger.log(Level.WARNING, "Can not send query.", e);
88 87 }
  88 +
  89 + mainView.getResultsPanel().fillTable(resultsCtrl.getVOTableData());
89 90 }
90 91  
91 92 @Override
92   - public void displayError(Exception e) {
93   - JOptionPane.showMessageDialog(mainView, "Error", e.getMessage(), JOptionPane.ERROR_MESSAGE,
94   - null);
  93 + public void displayError(String message, Exception e) {
  94 + logger.log(Level.SEVERE, message, e);
  95 + JOptionPane.showMessageDialog(mainView, e.getMessage(), message, JOptionPane.ERROR_MESSAGE);
95 96 }
96 97  
97 98 /** Copy the VOTable to a specified location. */
... ...