dirkvranckaert / my-episodes-watch-manager

Automatically exported from code.google.com/p/my-episodes-watch-manager
1 stars 2 forks source link

Login procedure (fault handling) #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Related to issue-28

Fault handling in login on line 193 (revision 76) is removed during solving 
issue-28. Compare revision 59 and 76.

189         int status = 0; 193         boolean result = 
false;
190         HttpEntity entity = null;   194         
String responsePage = "";
191     195             HttpResponse response;
192         try {   196             try {
193             HttpResponse response = httpClient.execute(post);   
197                 response = 
httpClient.execute(post);
194             status = response.getStatusLine().getStatusCode();  
198                 responsePage = 
EntityUtils.toString(response.getEntity());
195     199             } catch 
(ClientProtocolException e) {
196             response.getEntity().consumeContent();  200                 
e.printStackTrace();
197         } catch (UnknownHostException e) {  201             
} catch (IOException e) {
198             String message = "Could not connect to 
host."; 202                 e.printStackTrace();
199             Log.e(LOG_TAG, message, e); 203             
}
200             throw new 
InternetConnectivityException(message, e);  204 
201         } catch (IOException e) {   205         if 
(responsePage.contains("Wrong username/password")) {
202             String message = "Login to MyEpisodes failed.";     
203             Log.w(LOG_TAG, message, e);     
204             throw new LoginFailedException(message, e);     
205         }       
206         
207         if (status != 200) {

That small part of exception handling should be put back!

Original issue reported on code.google.com by dirkvran...@gmail.com on 2 May 2010 at 9:13

GoogleCodeExporter commented 8 years ago
File to change: MyEpisodesService.java

Original comment by dirkvran...@gmail.com on 2 May 2010 at 9:14

GoogleCodeExporter commented 8 years ago
Fixed by placing these catch blocks back!

Original comment by dirkvran...@gmail.com on 2 May 2010 at 9:19

GoogleCodeExporter commented 8 years ago
Something seems to be wrong

Original comment by dirkvran...@gmail.com on 2 May 2010 at 9:20

GoogleCodeExporter commented 8 years ago

Original comment by dirkvran...@gmail.com on 2 May 2010 at 9:21

GoogleCodeExporter commented 8 years ago
New issue created -> Issue 31

Original comment by dirkvran...@gmail.com on 2 May 2010 at 9:26