node-deadline
Version:
Module to interface with Deadline Compute Management System by Thinkbox Software
26 lines (19 loc) • 673 B
JavaScript
var Err = module.exports = function( type, message, solution ) {
//inherit from Error object
Error.call( this );
//check parameters
if ( "string" != typeof type ) { type = "UnknownError"; }
if ( "string" != typeof message ) { message = ""; }
if ( "string" != typeof solution ) { solution = ""; }
this.type = type;
this.message = message;
this.solution = solution;
};
Err.prototype = Object.create( Error.prototype );
Err.prototype.toString = function() {
return this.type + ": " + this.message + " (" + this.solution + ")";
};
//enumerator for types
Err.EXTERN = "ExternalError";
Err.PARAM = "ParameterError";
Err.NoIMPL = "ImplementationError";