python: Better exception reporting

Return more appropriate python exceptions instead of CreaterepoCError in some cases.