lançar um novo erro (
throw new Error('Whoops!')
gaz_edge
throw new Error('Whoops!')
try {
throw new Error('Whoops!')
} catch (e) {
console.error(e.name + ': ' + e.message)
}
try{
throw new Error ('Whoops!)
}catch (e) {
console.log(e.name + ':' + e.message
throw new Exception("Error here");
try {
//something that causes an error
} catch (ex){
if (ex instanceof TypeError){
//handle the error
} else if (ex instanceof ReferenceError){
//handle the error
} else {
//handle all others
}
}
throw new Error('Whoops!')
# :::::: - AGREAGAR SUDO, EN CENTOS 7 SERVER - :::::
#creamos el usuario
adduser junior
#creamos el pasword
passwd junior123
#agregamos el permiso de SUDO AL usuario "junior"
usermod -aG wheel junior
Error Name Description
EvalError An error in the eval() function has occurred.
RangeError Out of range number value has occurred.
ReferenceError An illegal reference has occurred.
SyntaxError A syntax error within code inside the eval() function has occurred.
All other syntax errors are not caught by try/catch/finally, and will
trigger the default browser error message associated with the error.
To catch actual syntax errors, you may use the onerror event.
TypeError An error in the expected variable type has occurred.
URIError An error when encoding or decoding the URI has occurred
(ie: when calling encodeURI()).
throw new Error("Your error message");