Added Log information
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-import-widget@85039 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
742ed3bac5
commit
70f7de8420
|
@ -12,6 +12,9 @@ import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportMonitor;
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.user.client.Timer;
|
import com.google.gwt.user.client.Timer;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
||||||
|
import com.sencha.gxt.widget.core.client.event.HideEvent;
|
||||||
|
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This {@link Timer} retrieves {@link OperationProgress} from the specified
|
* This {@link Timer} retrieves {@link OperationProgress} from the specified
|
||||||
|
@ -63,16 +66,7 @@ public class CSVImportProgressUpdater extends Timer {
|
||||||
break;
|
break;
|
||||||
case FAILED:
|
case FAILED:
|
||||||
cancel();
|
cancel();
|
||||||
Log.info("CSV Import Failed");
|
errorMessage(result);
|
||||||
if (result.getError() != null) {
|
|
||||||
fireOperationFailed(result.getError(),
|
|
||||||
"Failed Client Library Import", result
|
|
||||||
.getError()
|
|
||||||
.getLocalizedMessage());
|
|
||||||
} else {
|
|
||||||
fireOperationFailed(new Throwable("Failed"),
|
|
||||||
"Failed Client Library Import", "Error in import");
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case SUCCEDED:
|
case SUCCEDED:
|
||||||
cancel();
|
cancel();
|
||||||
|
@ -92,6 +86,35 @@ public class CSVImportProgressUpdater extends Timer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void errorMessage(CSVImportMonitor result) {
|
||||||
|
Log.info("CSV Import Failed");
|
||||||
|
Throwable th = null;
|
||||||
|
String failure = null;
|
||||||
|
String details = null;
|
||||||
|
if (result.getError() != null) {
|
||||||
|
th = result.getError();
|
||||||
|
failure = "Failed Client Library Import";
|
||||||
|
details = result.getError().getLocalizedMessage();
|
||||||
|
} else {
|
||||||
|
th = new Throwable("Failed");
|
||||||
|
failure = "Failed Client Library Import";
|
||||||
|
details = "Error in import";
|
||||||
|
}
|
||||||
|
fireOperationFailed(th, failure, details);
|
||||||
|
|
||||||
|
AlertMessageBox d = new AlertMessageBox("Error in CSV Import", details);
|
||||||
|
d.addHideHandler(new HideHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onHide(HideEvent event) {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
d.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
protected String getStack(Throwable e) {
|
protected String getStack(Throwable e) {
|
||||||
String message = e.getLocalizedMessage() + " -> <br>";
|
String message = e.getLocalizedMessage() + " -> <br>";
|
||||||
Throwable c = e.getCause();
|
Throwable c = e.getCause();
|
||||||
|
|
Loading…
Reference in New Issue