Added basic capturing and logging of exceptions thrown by feature switches.