It is better to use logger compared to raise exceptions