try and except error handling