Catch exception in portage_config

Closes #7031