Changeset 666:0ff0f0ba71d2
- Timestamp:
- 10/06/09 10:03:24 (4 years ago)
- Author:
- tgambet
- Branch:
- default
- convert_revision:
- svn:cdcfb263-7567-472c-a848-e2c2df3466e7/trunk@667
- Message:
-
new UnicornException? methods
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r651
|
r666
|
|
| 1 | | // $Id: URIRequest.java,v 1.11 2009-10-05 14:25:41 tgambet Exp $ |
| | 1 | // $Id: URIRequest.java,v 1.12 2009-10-06 10:03:24 tgambet Exp $ |
| 2 | 2 | // Author: Damien LEROY. |
| 3 | 3 | // (c) COPYRIGHT MIT, ERCIM ant Keio, 2006. |
| … |
… |
|
| 114 | 114 | logger.debug("URL : " + this.sURL + " ."); |
| 115 | 115 | logger.debug("Parameters : " + this.sParameter + " ."); |
| | 116 | String observerName = Framework.mapOfObserver.get(observerId).getName(sLang.split(",")[0]); |
| 116 | 117 | final URL aURL; |
| 117 | 118 | try { |
| … |
… |
|
| 132 | 133 | switch (responseCode) { |
| 133 | 134 | case HttpURLConnection.HTTP_NOT_FOUND: |
| 134 | | throw new UnicornException(Message.ERROR, "$message_observer_not_found " + Framework.mapOfObserver.get(observerId).getName(sLang.split(",")[0]), null); |
| | 135 | throw new UnicornException(Message.ERROR, "$message_observer_not_found", null, observerName); |
| 135 | 136 | case HttpURLConnection.HTTP_INTERNAL_ERROR: |
| 136 | | throw new UnicornException(Message.ERROR, "$message_observer_internal_error " + Framework.mapOfObserver.get(observerId).getName(sLang.split(",")[0]), null); |
| | 137 | throw new UnicornException(Message.ERROR, "$message_observer_internal_error", null, observerName); |
| 137 | 138 | } |
| 138 | 139 | |
| … |
… |
|
| 144 | 145 | throw new UnicornException(new Message(e)); |
| 145 | 146 | } catch (ConnectException e) { |
| 146 | | throw new UnicornException(Message.ERROR, "$message_observer_connect_exception " + Framework.mapOfObserver.get(observerId).getName(sLang.split(",")[0]), null); |
| | 147 | throw new UnicornException(Message.ERROR, "$message_observer_connect_exception", null, observerName); |
| 147 | 148 | } catch (SocketTimeoutException e) { |
| 148 | 149 | if (e.getMessage().contains("connect timed out")) { |
| 149 | | throw new UnicornException(Message.ERROR, "$message_observer_connect_exception " + Framework.mapOfObserver.get(observerId).getName(sLang.split(",")[0]), null); |
| | 150 | throw new UnicornException(Message.ERROR, "$message_observer_connect_exception", null, observerName); |
| 150 | 151 | } else if (e.getMessage().contains("Read timed out")) { |
| 151 | | throw new UnicornException(Message.ERROR, "$message_observer_read_timeout", null); |
| | 152 | throw new UnicornException(Message.ERROR, "$message_observer_read_timeout"); |
| 152 | 153 | } else { |
| 153 | 154 | throw new UnicornException(new Message(e)); |