Handle error appropriately