now shows fatal error message (if possible)

master
Ondřej Hruška 9 years ago
parent 16cd163cb8
commit 551a10bbf5
  1. 14
      index.php
  2. 6
      php-console.js
  3. 12
      styles.css

@ -1,6 +1,16 @@
<?php <?php
ini_set('log_errors', 0);
ini_set('display_errors', 1); /**
* PHP Sandbox: https://github.com/MightyPork/php-sandbox
*/
ini_set('log_errors', false);
ini_set('display_errors', true);
ini_set('display_startup_errors', true);
ini_set('display_not_found_reason', true);
ini_set('display_exceptions', true);
ini_set('html_errors', false);
error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
// --- Handle config --- // --- Handle config ---

@ -45,12 +45,12 @@
} }
// eval server-side // eval server-side
$.post('?js=1', { code: editor.getSession().getValue() }, function (res, status, jqXHR) { $.post('?js=1', {code: editor.getSession().getValue()}, function (res, status, jqXHR) {
var mem = jqXHR.getResponseHeader("X-Memory-Usage") || "", var mem = jqXHR.getResponseHeader("X-Memory-Usage") || "",
rendertime = jqXHR.getResponseHeader("X-Rendertime") || ""; rendertime = jqXHR.getResponseHeader("X-Rendertime") || "";
if (mem || rendertime) { if (mem || rendertime) {
$('.statusbar .runtime-info').text('Memory usage: '+ mem + ' MB, Rendertime: ' + rendertime + 'ms'); $('.statusbar .runtime-info').text('Memory usage: ' + mem + ' MB, Rendertime: ' + rendertime + 'ms');
} else { } else {
$('.statusbar .runtime-info').text(''); $('.statusbar .runtime-info').text('');
} }
@ -65,7 +65,7 @@
}; };
handleAjaxError = function (event, jqxhr, settings, exception) { handleAjaxError = function (event, jqxhr, settings, exception) {
$('div.output').html("<em>Error occured while posting your code.</em>"); $('div.output').html("<em>Error occured while posting your code.</em>" + jqxhr.responseText);
}; };
initializeAce = function () { initializeAce = function () {

@ -1,6 +1,6 @@
body, textarea, input { body, textarea, input {
font-size: 12px; font-size: 12px;
font-family: monospace "Source Code Pro"; font-family: "Source Code Pro", monospace;
} }
body { body {
@ -77,6 +77,16 @@ a {
word-wrap: break-word; /* Internet Explorer 5.5+ */ word-wrap: break-word; /* Internet Explorer 5.5+ */
} }
.output h1 {
margin: .5em 0 0 0;
}
.output p, .output pre {
margin: .5em 0;
-webkit-margin-before: 0;
-webkit-margin-after: 0;
}
.input-wrapper { .input-wrapper {
border-right: 4px solid #686860; border-right: 4px solid #686860;
} }

Loading…
Cancel
Save