feat: Enhance exception handling and improve error messages