Strong exception-safety for checked and unchecked exceptions