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;
}