X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fdbsources%2FPDBRestClient.java;h=320b1c57d670e0027d0660f1df25b8cf43f69629;hb=4d7f98a6dd54d9863ba449ec79dcd95d25ed863d;hp=7e80126d0f6566c0ea514c62759d1af75c1e0f57;hpb=c394157681d10261bd6f7883b19eaf88d6784609;p=jalview.git diff --git a/src/jalview/ws/dbsources/PDBRestClient.java b/src/jalview/ws/dbsources/PDBRestClient.java index 7e80126..320b1c5 100644 --- a/src/jalview/ws/dbsources/PDBRestClient.java +++ b/src/jalview/ws/dbsources/PDBRestClient.java @@ -1,5 +1,6 @@ package jalview.ws.dbsources; +import jalview.util.MessageManager; import jalview.ws.uimodel.PDBRestRequest; import jalview.ws.uimodel.PDBRestResponse; import jalview.ws.uimodel.PDBRestResponse.PDBResponseSummary; @@ -22,7 +23,6 @@ import com.sun.jersey.api.client.WebResource; import com.sun.jersey.api.client.config.ClientConfig; import com.sun.jersey.api.client.config.DefaultClientConfig; - /** * A rest client for querying the Search endpoing of the PDB REST API * @@ -102,16 +102,17 @@ public class PDBRestClient String exceptionMsg = e.getMessage(); if (exceptionMsg.contains("SocketException")) { - throw new Exception( - "Jalview is unable to detect an internet connection"); // No internet connection + throw new Exception( + MessageManager + .getString("exception.unable_to_detect_internet_connection")); } else if (exceptionMsg.contains("UnknownHostException")) { - throw new Exception( - "Jalview is unable to reach the host server \'www.ebi.ac.uk\'. " - + "\nPlease ensure that you are connected to the internet and try again."); // The server 'www.ebi.ac.uk' is unreachable + throw new Exception( + MessageManager + .getString("exception.pdb_server_unreachable")); } else { @@ -126,11 +127,12 @@ public class PDBRestClient switch (code) { case 410: - message = "PDB Rest Service no longer exists!"; + message = MessageManager + .getString("exception.pdb_rest_service_no_longer_available"); break; case 403: case 404: - message = "The requested resource could not be found"; + message = MessageManager.getString("exception.resource_not_be_found"); break; case 408: case 409: @@ -140,7 +142,7 @@ public class PDBRestClient case 503: case 504: case 505: - message = "There seems to be an error from the PDB Rest API server."; + message = MessageManager.getString("exception.pdb_server_error"); break; default: