Add framework for exception handling