When a user submits a module build and MBS fails establishing a session with Koji, the module build fails with the reason An unknown error occurred while validating the modulemd. This is misleading and leads the user to think their modulemd is invalid. Let's clarify this error when it's not an issue with their modulemd file.
An unknown error occurred while validating the modulemd
To do this, we probably want to normalize the exceptions that are raised by KojiModuleBuilder.get_session. That method should always raise the same type of exception so this particular error scenario can be handled cleanly in modules.py.init.
KojiModuleBuilder.get_session
modules.py.init
@lucarval I've tried to create a test for it, but it seems that modules.init doesn't call KojiModuleBuilder.get_session. Or I didn't understand this.
It doesn't call it directly, you're right. But something in there does. The error mentioned in description of issue is only found there. I was thinking if we had a custom exception, we could add another except-block in init to display the correct message.
init
@lucarval Yes, so that the way I thinking it works. I was just wondering how to test it then.
Metadata Update from @vmaljulin: - Issue assigned to vmaljulin
Commit b4d7fc4 fixes this issue
Login to comment on this ticket.