From fdb03dc89258bde53e671b25419d2ebeeb1d28e9 Mon Sep 17 00:00:00 2001 From: Nathanael Jourdane Date: Thu, 11 Feb 2016 18:27:54 +0100 Subject: [PATCH] VOTable: Move try/catch to controller view. --- src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableController.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableController.java b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableController.java index c072955..e6e0c3b 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableController.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableController.java @@ -43,7 +43,7 @@ public class VOTableController { voTable = VOTableParser.parseVOTable(voTablePath); fillView(); } catch (Exception e) { - view.displayError("VOTable can not be displayed", e.getMessage()); + view.displayError("VOTable can not be displayed.\nReason:\n", e.getMessage()); } } @@ -66,7 +66,7 @@ public class VOTableController { voTable = VOTableParser.parseVOTable(voTablePath); fillView(); } catch (Exception e) { - view.displayError("VOTable can not be displayed", e.getMessage()); + view.displayError("VOTable can not be displayed.\nReason:\n", e.getMessage()); } } @@ -84,13 +84,9 @@ public class VOTableController { throw new Exception("VOTable with more than one table are not yet supported."); } Table table = (Table) (voTable.getRESOURCE().get(0).getLINKAndTABLEOrRESOURCE().get(0)); - try { - VOTableDataParser dataParser = new VOTableDataParser(table); - view.buildArray(dataParser.getColumnsName(), dataParser.getDataArray()); - } catch (Exception e) { - view.displayError("VOTable can not be displayed", - "Can not parse VOTable data.\nReason:\n" + e.getMessage()); - } + + VOTableDataParser dataParser = new VOTableDataParser(table); + view.buildArray(dataParser.getColumnsName(), dataParser.getDataArray()); } /** -- libgit2 0.21.2