function bar() {
// In this case, we are going to catch any errors thrown by baz(), log them to the
// console, and then rethrow them.
try {
baz();
} catch ( error ) {
console.log( "Error caught and rethrown in Bar():", error.message );
// In JavaScript, there is no special "rethrow" keyword. You simply throw() the
// error that you caught. This will maintain the original stacktrace recorded by
// the error as you "pass it back up" the call-stack.
throw( error );
}
}