Why have a sandbox when you can have a wetbox try { // ... } catch(e) { window.location.href = "http://stackoverflow.com/search?q=[js]+" + e.message; }