Handle exceptions in registration