Exception handling and resolving errors