This specific case appears to have been fixed a while ago. I couldn't find the specific commit, but running this test case in 20.04, an error is printed in the terminal, but no exception is raised.
** Changed in: software-properties (Ubuntu) Status: Confirmed => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/953424 Title: add-apt-repository does not handle malformed repo URL nicely To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/953424/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs