title: continue execution after a throw in JS
body: <p>i have this function in my code and I'm using <code>throw</code> to create meaningful errors (rather than failing silently). However, when i structure my function this way, if i call <code>defineSandbox()</code> with an error, it stops the whole script.</p>
  
  <pre><code>//defineSandbox is in an object, for now i name "myObj"
  
  var defineSandbox = function (sandboxName,SandboxDefinition) {
  
      //validation
      if(!is.validString(sandboxName)) {
          throw statusMessages.sandbox.invalidName;
      }
      if(!is.validFunction (SandboxDefinition)) {
          throw statusMessages.sandbox.invalidDefinition;
      }
  
      //...some more validation here
  
      //...sandbox builder code if validation passes (code wasn't returned)
  
      registered.sandboxes[sandboxName] = newSandbox;
  };
  
  //intentional error, non-string name
  myObj.defineSandbox(false);                        
  
  //...and so the rest of the script from here down is not executed  
  
  //i can't build this sandbox anymore
  myObj.defineSandbox('mySandbox',function(){...});  
  </code></pre>
  
  <p>what i would like to have is if one call fails, it gives out an error but still tries  to continue to run the script. how do i structure this code so that i can achieve that?</p>