public Alert(Throwable caught) {
String title;
String html;
if(caught instanceof StatusCodeException) {
StatusCodeException ex = (StatusCodeException) caught;
switch(ex.getStatusCode()) {
case 0:
title = "Connection Error !";
html = "An error occurred while attempting to contact the server. Please check your network connection and try again.";
break;
case 500:
title = "Server Error !";
html = "An error occured at server. Please try again. If problem persists, contact administrator.";
break;
default:
title = "Error " + ex.getStatusCode() + " !";
html = ex.getEncodedResponse();
}
} else if(caught instanceof ServerException) {
title = "Server Error !";
html = caught.getMessage();