Skip to content

Instantly share code, notes, and snippets.

@iamstoick
Forked from xeolabs/tryCatchSO.js
Created February 7, 2016 12:09
Show Gist options
  • Select an option

  • Save iamstoick/a7302cc1364c0ef982b8 to your computer and use it in GitHub Desktop.

Select an option

Save iamstoick/a7302cc1364c0ef982b8 to your computer and use it in GitHub Desktop.

Revisions

  1. @xeolabs xeolabs created this gist Feb 5, 2016.
    8 changes: 8 additions & 0 deletions tryCatchSO.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    try {
    function foo() {
    foo();
    }
    foo();
    } catch(e) {
    window.location.href="http://stackoverflow.com/search?q=[js]+" + e.message || e;
    }