[Hattrickirc-commitlog] HattrickIRC/src/org/hattrick/hattrickirc/net HattrickConnection.java, 1.10,
Status: Beta
Brought to you by:
suls
From: Mathias S. <su...@us...> - 2006-10-01 17:41:14
|
Update of /cvsroot/hattrickirc/HattrickIRC/src/org/hattrick/hattrickirc/net In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv20808/src/org/hattrick/hattrickirc/net Modified Files: HattrickConnection.java Log Message: Changes from Boy van der Werf (nethyperon) Index: HattrickConnection.java =================================================================== RCS file: /cvsroot/hattrickirc/HattrickIRC/src/org/hattrick/hattrickirc/net/HattrickConnection.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- HattrickConnection.java 8 Jul 2005 14:01:57 -0000 1.10 +++ HattrickConnection.java 1 Oct 2006 17:41:07 -0000 1.11 @@ -129,26 +129,22 @@ * @param cmd Request url * @return The xml output */ - public Element performCommand(String urlFragment) { + public Element performCommand(String urlFragment) throws Exception { // TODO: make sure that a timeout won't affect the query // remember to add matches after a timeout occured logger.debug("performing command: " + urlFragment); - try { - if(hattrickServerURL == null) { - hattrickServerURL = "http://www.hattrick.org"; - } - URL requestUrl = new URL(hattrickServerURL + urlFragment); - HttpURLConnection huc = (HttpURLConnection) requestUrl.openConnection(); - huc.setRequestProperty("User-Agent", USER_AGENT); - huc.setRequestProperty("Cookie", sessionCookie); - - SAXBuilder builder = new SAXBuilder(); - Document doc = builder.build(huc.getInputStream()); - - return doc.getRootElement(); - } catch(Exception e) { - logger.error("couldn't perform the command: ", e); - } - return null; + + if(hattrickServerURL == null) { + hattrickServerURL = "http://www.hattrick.org"; + } + URL requestUrl = new URL(hattrickServerURL + urlFragment); + HttpURLConnection huc = (HttpURLConnection) requestUrl.openConnection(); + huc.setRequestProperty("User-Agent", USER_AGENT); + huc.setRequestProperty("Cookie", sessionCookie); + + SAXBuilder builder = new SAXBuilder(); + Document doc = builder.build(huc.getInputStream()); + + return doc.getRootElement(); } } \ No newline at end of file |