handle play.rust-lang.org communication errors in playpens

also add 15s communication timeout
This commit is contained in:
Michal Budzynski 2017-08-06 14:59:03 +02:00
parent 35a447d08a
commit eed1a0a591
1 changed files with 5 additions and 1 deletions

View File

@ -329,8 +329,12 @@ function run_rust_code(code_block) {
dataType: "json", dataType: "json",
contentType: "application/json", contentType: "application/json",
data: JSON.stringify(params), data: JSON.stringify(params),
timeout: 15000,
success: function(response){ success: function(response){
result_block.text(response.result); result_block.text(response.result);
} },
error: function(qXHR, textStatus, errorThrown){
result_block.text("Playpen communication " + textStatus);
},
}); });
} }