title: Handling prerequsites load failure in RequireJS require function
body: <p>I'm using RequireJS for AMD. Using this code I execute my function after ensuring the <code>module1</code> is loaded:</p>
  
  <pre><code>require(['module1'], function (module1) {
      if (module1) {
          // My function code...
      }
  ); 
  </code></pre>
  
  <p>In some cases the <code>module1</code> is not available (mostly because of access security). I want to handle what happens if <code>module1</code> failed to load. Using some code like:</p>
  
  <pre><code>require(['module1'], function (module1) {
      if (module1) {
          // My function code...
      }
  )
  .fail(function(message)
  {
      console.log('error while loading module: ' + message);
  }
  </code></pre>
  
  <p>or maybe the require function accepts another parameter for module load failures?</p>
  
  <p>So the question is, how can I handle if the required module failed to load?</p>