pjs.Error() Constructor



The pjs.Error() constructor instantiates a Profound.js error object. It is derived from the JavaScript Error() object, but has additional features that map errors to status codes.

Parameters
  1. Error or status code

  2. Status code (available when giving custom error message)

Examples
throw new pjs.Error(9999); // Program exception in system routine. throw new pjs.Error("Something bad happened.", 9999);   var myErr = new pjs.Error("It's bad!", 9999); // Set internal error flag pjs.setError(myErr);   // Throw JavaScript error throw myErr;