erknrio
2/25/2016 - 10:41 AM

Excepcion con texto y numero.

Excepcion con texto y numero.

function CustomException(text, num) {
  if (typeof text !== "string" || text === null || text === undefined) {
    text = '';
  }

  if (typeof num !== "number" || num === null || num === undefined) {
    num = 0;
  }

  this.message = text;
  this.code = num;
}