handling exception on python side and added common base
handling exception on python side and added common base