You should be checking error here and raising an exception.