/*global hsp*/
/*jslint white:false, browser:true, devel:true */
(function () {
  // globals
  var lib,stage;
  // config
  lib = hsp;

  stage = lib.stage || 'prod';
  // add the 'handle' function to the lib
  lib.handle = function (e) {
    if (stage === 'devel') {
      // do an alert for development
      alert(e.name + "\n" + e.message + "\n" + e.sourceURL + "\nline: " + e.line);
      throw e;
    }
    else {
      throw e;
    }
  };
  lib.run = function (fn) {
    try {
      fn();
    }
    catch (e) {
      lib.handle(e);
    }
  };
  
}());


