/*
 This helper modules allows us to create different type of errors we can throw
*/
function customError(message, errorName)
{
  this.name = errorName || "Error";
  this.message = message;

  var stackParts = new Error().stack.split("\n");
  stackParts.splice(0,2);
  stackParts.unshift(this.name + ": " + message);

  this.stack = stackParts.join("\n");
}
customError.prototype = Error.prototype;

module.exports = customError;

@@ -1,11 +1,32 @@
 /*
-%0A
+*%0A * CustomError%0A *%0A *
  This he
@@ -100,233 +100,317 @@
 row%0A
-*/%0Afunction customError(message, errorName)%0A%7B%0A  this.name = errorName %7C%7C %22
+ *%0A * @class CustomError%0A * @extends %7BError%7D%0A */%0Aclass CustomError extends Error %7B%0A  /**%0A   * Creates an instance of Custom
 Error
-%22;%0A  this.message = message;%0A%0A  var stackParts = new Error().stack.split(%22%5Cn%22);%0A  stackParts.splice(0,2);%0A  stackParts.unshift(this.name + %22: %22 + 
+.%0A   * @param %7B*%7D message%0A   * @param %7Bstring%7D %5Bname='Error'%5D a custom name for the error object%0A   * @memberof CustomError%0A   */%0A  constructor(message, name = 'Error') %7B%0A    super(
 mess
@@ -419,89 +419,88 @@
 e);%0A
-%0A
+  
   this.
-stack = stackParts.join(%22%5Cn%22);%0A%7D%0AcustomError.prototype = Error.prototype;
+name = name;%0A    Error.captureStackTrace(this, this.constructor);%0A  %7D%0A%7D
 %0A%0Amo
@@ -514,17 +514,17 @@
 ports = 
-c
+C
 ustomErr

rewrite the module using class syntax