error handling for giving the predictor non-existent UUIDs

pull/73/head
Jon Sowman 2010-07-21 05:12:16 -07:00
rodzic 70e7fb3387
commit 80edc67d72
1 zmienionych plików z 10 dodań i 5 usunięć

Wyświetl plik

@ -37,12 +37,17 @@ $(document).ready(function() {
populateFormByUUID(current_uuid);
appendDebug("Trying to get progress JSON");
$.getJSON("preds/"+current_uuid+"/progress.json", function(progress) {
appendDebug("Got progress JSON from server for UUID");
if ( progress['error'] || !progress['pred_complete'] ) {
appendDebug("The prediction was not completed correctly, quitting");
if ( progress != null ) {
appendDebug("Got progress JSON from server for UUID");
if ( progress['error'] || !progress['pred_complete'] ) {
appendDebug("The prediction was not completed correctly, quitting");
} else {
writePredictionInfo(current_uuid, progress['run_time'], progress['gfs_timestamp']);
getCSV(current_uuid);
}
} else {
writePredictionInfo(current_uuid, progress['run_time'], progress['gfs_timestamp']);
getCSV(current_uuid);
appendDebug("Couldn't find the progress JSON for the supplied UUID");
throwError("You requested a UUID that doesn't seem to exist on the server. Please re-run");
}
});
}