more permanent example:

function fun(title, func) { 
  try {
    console.log(title); 
    func();
  } catch(e) {
    console.log(e.name);
  }
}
fun("hello", function() { throw { name: "ko" }})