mirror of
https://github.com/klmp200/PQT_Gestionnaire_vente_stock.git
synced 2024-11-22 00:03:20 +00:00
[CLIENT] #19 : Les erreurs de connexion HTTP sont désormais correctement gérés par le client, et une erreur HTTP 500 ne bloque plus la connexion
This commit is contained in:
parent
f521c48d22
commit
387e797d6e
@ -46,4 +46,16 @@ public class ConnectionListenerAdapter implements IConnectionListener {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see com.pqt.client.module.connection.listeners.IConnectionListener#onConnexionError(Throwable)
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public void onConnexionError(Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,4 +12,5 @@ public interface IConnectionListener extends EventListener {
|
||||
|
||||
void onTimeOutEvent();
|
||||
|
||||
void onConnexionError(Throwable e);
|
||||
}
|
||||
|
@ -37,12 +37,10 @@ public class HttpTextSender implements ITextSender{
|
||||
}
|
||||
|
||||
con.disconnect();
|
||||
|
||||
}catch (java.net.SocketTimeoutException | ConnectException e){
|
||||
}catch (Exception e) {
|
||||
//TODO Issue #6 : ajouter un log ici
|
||||
listener.onTimeOutEvent();
|
||||
}catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
listener.onConnexionError(e);
|
||||
}finally {
|
||||
listener.onDisconnectedEvent();
|
||||
}
|
||||
|
@ -80,6 +80,11 @@ public class QueryExecutor {
|
||||
public void onTimeOutEvent() {
|
||||
callback.err(new MessageTimeoutException());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnexionError(Throwable e) {
|
||||
callback.err(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -121,6 +126,11 @@ public class QueryExecutor {
|
||||
public void onTimeOutEvent() {
|
||||
callback.err(new MessageTimeoutException());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnexionError(Throwable e) {
|
||||
callback.err(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -158,6 +168,11 @@ public class QueryExecutor {
|
||||
public void onTimeOutEvent() {
|
||||
callback.err(new MessageTimeoutException());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnexionError(Throwable e) {
|
||||
callback.err(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user