From eed1a0a591f3be5636b5ad051dd01b46f07426c8 Mon Sep 17 00:00:00 2001 From: Michal Budzynski Date: Sun, 6 Aug 2017 14:59:03 +0200 Subject: [PATCH] handle play.rust-lang.org communication errors in playpens also add 15s communication timeout --- src/theme/book.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/theme/book.js b/src/theme/book.js index 4ff47cbf..33eed34d 100644 --- a/src/theme/book.js +++ b/src/theme/book.js @@ -329,8 +329,12 @@ function run_rust_code(code_block) { dataType: "json", contentType: "application/json", data: JSON.stringify(params), + timeout: 15000, success: function(response){ result_block.text(response.result); - } + }, + error: function(qXHR, textStatus, errorThrown){ + result_block.text("Playpen communication " + textStatus); + }, }); }